Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Algorithm design

by graff (Chancellor)
on May 26, 2002 at 02:29 UTC ( [id://169328]=note: print w/replies, xml ) Need Help??


in reply to Algorithm design

This thread has given me a lot of reassurance, because I find a lot of my own practice and daily experience being attested by others.

One practice that I tend to use heavily, and try to impose on apprentice programmers when they work with me, is to start each separate file of perl code with commentary that provides summary documentation about what the code in this file is supposed to do and how it does this -- before writing any of the actual perl code. If the code is supposed to run from the command line, there must be a "$Usage" variable that gets printed to stderr when appropriate, which not only lists but briefly explains all available options (and the internal documentation can/should explain in more detail).

In any case, this initial documentation must be clear about what the program expects as input, what it produces as output, and the nature of the task that it performs in between. For GUI applications, there should be a summary about what is presented to the user, and what sorts of decisions/choices the user is expected to make.

But getting this commentary written FIRST, before any of the actual code, tends to keep the coding process more focused, more effective, more likely to succeed sooner, and more maintainable months later.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (2)
As of 2024-04-26 05:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found