Most IDEs will format your code for you these days, making sure that your braces are always where you want them to be, and that everything is indented properly. Some will do even more for you. Eclipse provides save actions that will make sure that you always include braces around blocks, and even sort your methods and declarations for you.

How much control do you turn over to your editor? Lately I’ve been inclined to let the editor do as much as it can. Aside from aesthetics, I’ve decided that the single most important advantage offered by consistently formatted and organized code is high quality diffs when you’re reviewing your code history.

If you enforce the same formatting and organization on your code, theoretically the revision history for a file will contain only substantive changes. That provides real value as far as I’m concerned.

The only disadvantage I’ve found so far is that if you use save actions to organize your code and you save a file that has conflicts marked, the save action will make a huge hash of it. (Maybe Eclipse should have an option for disabling save actions when saving a file that has errors.) That’s easy to reverse, though, with an Undo.

Anyone else have an opinion on this? I’m finding myself wishing that I had a tool that does as good a job organizing and formatting Ruby code as Eclipse does with Java.