Before you read this, I want to make one thing clear - I am not obsessive-compulsive. But some things annoy me about neat programming sometimes. Sometimes I just write new code that is neatly tabbed and aligned the way I like it. Other times I look at the old code that is around my new code. I turn on hidden characters and gasp at the spaces instead of tabs, and the whitespace at the end of most lines.
Leaving trailing whitespace is one thing, but not adhering to the project’s indentation scheme is another. Here at Netbasic, we use the TAB character to indent, not SPACE like some UNIX programs. Personally I prefer tab, as it’s neat, and you can adjust how wide each tab is in most editors, so you can lay your code out as indented or un-indented as you like. One feature I liked in UltraEdit though is the ability to remove trailing whitespace in a file. As far as I can tell, PhpED (although my new favourite editor) doesn’t have this feature.

April 18th, 2008 at 5:42 pm
Well, it turns out that PhpED does actually have an even better feature for trailing whitespace removal - in the Editor settings, by default “Keep trailing blanks” is enabled. Disable this and it automatically removes trailing whitespace. Better than UltraEdit where you have to click a menu item to clear whitespaces from the file!