Importance of Code Comments
Posted by plorimer on 2009/10/15
The further I go in my computing education, the more entertaining I find it to look back on previous assignments and projects that I have worked on. It’s entertaining because the code that I wrote as a first year, is in my opinion terrible. It’s not only the fact that my code was terribly inefficient, it’s the fact that I have no clue what I was doing at all. I say to myself wow! that was a really stupid way of doing that, why would I do that? The problem is I will never know, I never really made useful comments.
I think that code commenting is something that is really important, at least for me. This article on why code commenting is so important, is pretty interesting. The article mentions code that is self documenting, that there is no such thing. I think that code can be self documenting, but I don’t think that alone is enough.
The reason I find this interesting is because when I was in my earlier years as a compsci student, I thought that I would just not comment in the workplace. Thus, giving myself a niche and great job security. I know this sounds stupid, but thats the way I thought. I have since realised that would be insanity. It has nothing to do with the fact that other people would not be able to read my code. It has everything to do with the fact that after I don’t look at a piece of code for 24 hours I have no clue what I was doing. Call me forgetful, but I know that there are many others out there like that.
After working some time on the IDE4EDU project, I realise the importance of proper documentation. If everyone just assumed that what they did was common sense, large software projects like Eclipse would be in shambles.
Now considering commenting was never really enforced until mid way into my second year. I’m of the opinion code comments should be worth close to the same amount as functional code from year one. That’s just my opinion.