Re: Commenting the source code.
From: Malcolm (malcolm_at_55bank.freeserve.co.uk)
Date: 10/23/04
- Next message: Tim Rentsch: "Re: GetByte(int x, int n)"
- Previous message: Malcolm: "Re: Tail space in struct within struct"
- In reply to: Profetas: "Re: Commenting the source code."
- Next in thread: Joona I Palaste: "Re: Commenting the source code."
- Reply: Joona I Palaste: "Re: Commenting the source code."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 23 Oct 2004 09:16:03 +0100
"Profetas" <xuxu_18@yahoo.com> wrote
>
> My theory is that commenting whilst you are coding,
> will break your concentration on what you were programming.
>
> If it is something complex.
>
> Does anybody agree?
>
Yes. Comments are for people, including you after some time, who need to
look at the code after it is finished. If you put in comments during actual
writing you may need to take them out, you may find it hard to "comment out"
code, and, worst of all, you may invalidate a comment and forget to change
it, something no compiler can catch.
Also, as you say, writing comments may take your attention from the actual
code. People will differ in this, but certainly if someone has imposed a
very burdensome commenting regime on you then it may slow you down
considerably if you try comment as you code.
I am not absolutely systematic, but normally I write code in modules without
comments. Then I test it. When the module is "ready" I put in comments
saying what all the functions do and how to call them. If it is presentation
code I might also comment non-obvious lines (eg "BMP files begin with
letters BM", or "sign extend"), generally I also comment structure members.
- Next message: Tim Rentsch: "Re: GetByte(int x, int n)"
- Previous message: Malcolm: "Re: Tail space in struct within struct"
- In reply to: Profetas: "Re: Commenting the source code."
- Next in thread: Joona I Palaste: "Re: Commenting the source code."
- Reply: Joona I Palaste: "Re: Commenting the source code."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|