Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: The art of comments: (rave from the grave)

by cees (Curate)
on Jul 07, 2005 at 15:18 UTC ( [id://473120]=note: print w/replies, xml ) Need Help??


in reply to Re: The art of comments: (rave from the grave)
in thread The art of comments: (rave from the grave)

I like these types of comments as well, but I also find that lots of programmers tend lie in these comments. The comment may have been accurate at one point, but a small API change altered the behaviour of the function, yet the comment was never updated. I have seen this is my code (*blush*) as well as in others, and it can really throw you off.

Here is a maxim that I usually go by: The farther away a comment is from the code it tries to explain the less reliable it is.

  • Comment on Re^2: The art of comments: (rave from the grave)

Replies are listed 'Best First'.
Re^3: The art of comments: (rave from the grave)
by magnus (Pilgrim) on Jul 07, 2005 at 15:29 UTC
    yes, i agree... for me, it is a balance between updated code and updating/revising comments... and commenting blocks is trickier than lines, as, as you say, it can become fast impossible to tell just what is being commented on and what isn't... and too many line comments makes the code almost unreadable...

    magnus

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://473120]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2024-04-19 18:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found