Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: What makes a comment "obnoxious"?

by saberworks (Curate)
on Sep 09, 2007 at 01:05 UTC ( [id://637883]=note: print w/replies, xml ) Need Help??


in reply to What makes a comment "obnoxious"?

Yes, I find large groups of hash marks completely annoying. Your subs should be separated by meaningful comments that detail what the function does, what it expects as arguments, and what it returns. If you have a decent syntax-highlighting editor, your pod comments should be enough to provide a very easy-to-see separation between your subs. If I'm scanning through subroutines, I just search for the word "sub" and hit next, next, next, etc.

Replies are listed 'Best First'.
Re^2: What makes a comment "obnoxious"?
by adrianh (Chancellor) on Sep 09, 2007 at 16:55 UTC
    Your subs should be separated by meaningful comments that detail what the function does, what it expects as arguments, and what it returns

    Or (even better!)

    • The function name should reveal what the function does. If it doesn't change it.
    • The name of the vars you rip out of @_ should reveal what the function takes. If they don't change them.

    • The name of the variable you a return() should reveal what is being returned. If it doesn't update it.

    (guess who is thoroughly sick of lying comments in legacy code :-)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-19 17:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found