Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Documenting Methods/Subs

by jynx (Priest)
on Jan 13, 2003 at 20:15 UTC ( #226580=note: print w/ replies, xml ) Need Help??


in reply to Documenting Methods/Subs


TMTOWTDI,

If i'm going to comment my code (which i only do for something which others will have to see and/or maintain) than i use the following setup which i have derived from my coding experiences:

## # Function: get_input # Receives: nothing # Returns : user input regarding previous menu, Taint checked and chom +ped. # Notes : none ##
The notes area will explain any code that isn't self-documenting before one gets to the code. The "receives" and "returns" sections detail what will be set up before and after the function runs (pre/post-conditions). However, due to my idiosyncracies, they are usually pragmatic pre/post-conditions, not solid theoretical ones. When the code is written well it's only four lines. When it's not i'll have huge sections describing what's going on, which is usually when i decide to re-write it :-)

Anyway, there's another $0.02 for your hat,
jynx


Comment on Re: Documenting Methods/Subs
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (12)
As of 2014-08-01 14:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Who would be the most fun to work for?















    Results (25 votes), past polls