[lazarus] Comments

Vincent Snijders vslist at zonnet.nl
Wed Feb 26 09:25:35 EST 2003

> Van: Ian Bell [mailto:ian at redtommo.com]
> On Wednesday 26 Feb 2003 2:38 am, jozsef at wingchun.hu wrote:
> > Hello,
> >
> > I'm sure there is the "WHY" poeple do not use comments. I do not know it
> > and I am curious.
> Probably laziness.  Many programmers are so keen to make progress they
> 'forget' to comment thier code.  i think this is a mistake in any
> code and
> especially open source code where the idea is others can look at
> the code to
> undestand how it works and either improve it or derive other code from it.
> Arguments like 'the code is self documenting' just do not wash.
> Ian

Maybe writing good, useful comments is more difficult than writing code...

At least most of the times, when I write a piece of code I don't know what
to add to it in comments, except the plain obvious like:
function TUnitList.GetItem(Index: integer): TUnit;
The function GetItem returns a Unit from the UnitList. It has one parameter
Index, which is the index of the unit in the list of the returned unit.

Also it is not immediately clear if some comment is good, usefull. Code is
checked by the compiler and by tests to see if it works. For comments there
is no such simple checking mechanism.

Vincent Snijders.

More information about the Lazarus mailing list