I was just over at slashdot reading a post about the importance of commented code. Typically, the majority of peoples responses to articles over at /. are pretty worthless and I just skip over them. However, one caught my eye:
The canonical form of your maxim is “If you don’t have time to do it right the first time, when will you find time to do it again?”. The correlary is: “The problem with quick and dirty is that dirty remains long after quick is forgotten.”
I don’t think I can stress enough how important comments are. However, at times I am a hypocrite and gloss right over commenting code. In my mind I think it too simple to warrant any commentary. Then, three years later, when the client wants to change how something is done, I find myself wondering, “What the hell was I thinking?” A comment, even on small “simple” code can be a real boon at times.
Also, remember, that you won’t be the only person who ever looks at your code. Eventually, some other poor chump is going to have to dig into your undocumented masterpiece and try to figure out what kind of mad genius came up with it all. And trust me, they won’t be calling you a mad genius!