http://www.perlmonks.org?node_id=136275


in reply to Re: Re: Re: do/redo or for(;;): what's Kosher?
in thread do/redo or for(;;): what's Kosher?

Comments are evil.

It's not that you should not comment, for even evil things are necessary, but it is the duty of the good person to avoid doing evil where practical.

Comments are evil, because they can lie. Code does not lie, it is the ultimate presentation of the truth. Sometimes, the truth can be hard to understand, but it is not wrong, only obscured.

If you create your loop:

# while(1) { .. redo }

Then any maintainer or formatting program can come and change that comment, or the code it supports, with no effect on the functionality of the program. Your testing suite will continue to work, your users will notice no difference, and yet your program contains a lie. This lie can cause no end of grief down the road, as programmers read comments and code alike as the truth.

It is the duty of the programmer to convey the truth of the program, to both computer and maintainer alike. It is the duty of the language, to convey that truth to the computer in an efficient manner, and to the maintainer in a manner easy to understand. Do not take upon yourself the duty of the language without good cause, you will cause much suffering to the maintainer.