I’ll fix it later…
We’ve all done it, and its bad enough when you’re maintaining your own code… but if you are working with other developers (or if someone may one day be working with your code), the ‘dirty hack now, fix it later’ way of coding is simply not acceptable.
Source is for human beings to read. Disregarding this truth is the first step on a dark path. Taking the time to do it right the first time pays off fast.
A lot of it isn’t even hard to do. Naming your variables clearly consumes mere seconds, and pays off by reducing the amount of documentation you need to write. For example, naming an object “scd1″ and not OverviewMenu creates the need for documentation that you can avoid. If you append an item to scd1, someone looking at your code may need to figure out what scd1 actually does to understand that, while appending an item to OverviewMenu probably means you’re adding an item to the menu. The code documents itself.
Indenting your code properly is trivial to carry out (and all but the most primitive editors make it very easy to do without thinking about it), and it simplifies understanding program flow.
Doing it the ‘easy’ way now and intending to fix it later is almost always a recipe for trouble, and more often than not it creates more work for you very quickly. Now you have ugly code that needs fixing, and replacing it can take longer than it would have to write it well in the first place. Besides, why write something just to throw it out? Your time is worth more than that.
If it’s worth doing at all, it is worth doing right. Please, don’t create more work than you need to for yourself, and other developers.