Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

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


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,

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2017-09-22 06:59 GMT
Find Nodes?
    Voting Booth?
    During the recent solar eclipse, I:

    Results (259 votes). Check out past polls.