The Mudcat Café TM
Thread #28443   Message #353095
Posted By: Bert
07-Dec-00 - 11:41 AM
Thread Name: BS: Is this comprehensible?
Subject: RE: BS: Is this comprehensible?
You are 100% correct Jon. When I was teaching programming I used to teach my students 'Do NOT use COMMENTS'. And they knew that BEFORE any test and they were taught why.

Your variable names and procedure names should be chosen carefully enough that your code is self explanatory.

That's exactly what you did. The real reason for NEVER using comments is that comments NEVER get updated.

Look at ANY old piece of code that has comments in it and you will find comments which are out of date and are therefore wrong and misleading.

The only exception to this is when you are using a language which does not contain modern programming language structures (like HTML and other pseudolanguage stuff) and then it may be necessary to occasionally add an explanation.

But in Pascal, Cobol, Fortran, Ada, and heaven forbid even C or Perl. Comments are not a substitute for good programming.

Bert.