Why You Should Comment Your Code
March 22nd, 2009I know at times when you’re in the middle of a project, buried deep in the guts of its code, it’s hard for you to imagine that you could forget what you were trying to do. You may think: “There’s no way I won’t remember what this function does. I spent x amount of time coding and testing it.” But, step away for a few weeks or more, and you just may be surprised. (Hey, if the project’s big enough, I’m sure it wouldn’t even take that long.) That’s why it’s important to not only have well formatted code, (you know, everything lined up, etc.), but also to comment your code! Even something as seemingly simple as a stylesheet can benefit from notes. (Why I used this fix here, or that style there.)
I know, at least for me, commenting’s often the last thing on my mind when I’m coding something. But, if you don’t already, try and get in the habit of doing it. I’m sure you won’t regret it.










