Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re: Re: Re: Re: do/redo or for(;;): what's Kosher?

by Anonymous Monk
on Jan 04, 2002 at 18:41 UTC ( #136275=note: print w/replies, xml ) Need Help??

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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://136275]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2018-06-18 03:06 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (107 votes). Check out past polls.