Sunday, October 2, 2011

Comments in Compurer Programs - why?

IMO comments in computer codes are waste. 99% of the time these are dead text that no one uses or doesn't carry much sense. I kept 1% separate hoping there are cases where probably it make sense - though I have my doubt.
Like any other languages - English, Assamese, Hindi, Marathi, France  etc, computer languages like java, C++, Ruby, SQL, C# etc are also medium of expression - a medium through which a programmer expresses what he or she wants to perform - his/ her thoughts. In "Structure and Interpretation of Computer Programs", Abelson and Sussman mentioned what computer programs are for

First, we want to establish the idea that a computer language is not just a way of getting a computer to perform operations but rather that it is a novel formal medium for expressing ideas about methodology. Thus, programs must be written for people to read, and only incidentally for machines to execute
So, programs must be written for the people to read and understand. When we speak to some one we don't use comments - listener understands what the speaker is talking. Using comments is like using interpreter - the other person doesn't understand what speaker is talking & such cases cause transmission loses & productivity.