Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Seven habits of highly careful coders

by bwelch (Curate)
on Sep 15, 2003 at 15:08 UTC ( #291573=note: print w/ replies, xml ) Need Help??


in reply to Seven habits of highly careful coders

Relating this to recent projects involving updates and additions to other people's code, it reminds me of ways to both test legacy code and document my own.

In testing legacy code:
- Is it still in use? If not, why?
- What's the scope? Exactly where will this work and where will it fail?
- Is the author still around so I may ask questions?
- Is it worth figuring this out and updating it, or would I be better off starting over?

In documenting my own code:
- What does this code do and why was it created?
- Include a history section that documents changes and dates.
- Add a simple outline if it's complex so it's easy to understand it without studying all the code.
- Document the code assuming you'll be trying to understand it two years in the future and you don't remember anything about it.


Comment on Re: Seven habits of highly careful coders
Re2: Seven habits of highly careful coders
by dragonchild (Archbishop) on Sep 15, 2003 at 15:54 UTC
    - Include a history section that documents changes and dates.

    Isn't this what change-control (such as CVS or SourceForge) is for? I would use CHANGES sections for release notes and keep version changes relegated to source control. Otherwise, the source file gets too cluttered up!

    ------
    We are the carpenters and bricklayers of the Information Age.

    The idea is a little like C++ templates, except not quite so brain-meltingly complicated. -- TheDamian, Exegesis 6

    Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2014-08-29 02:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (275 votes), past polls