[prog] Unit testing

Kathryn Andersen kat_lists at katspace.com
Fri Sep 3 06:57:14 EST 2004


On Thu, Sep 02, 2004 at 09:48:59PM +0200, Almut Behrens wrote:
> Regrettably, it took me quite some time to admit to myself, and truly
> accept, that my memory isn't as good as I'd like it to be...  In that
> respect (i.e. some months later) the original coder is often not much
> better off than anyone else with the same general level of expertise 
> (BTW, this has nothing to do with whether you wrote your code in perl,
> or not ;).  IOW, comments should ideally be written as if you were
> explaining matters to someone else.

Another rule of thumb for comments is that if you found it hard to
understand yourself, you should *definitely* comment it.  This doesn't
usually happen so much with initial writing, because concepts are fresh
in your head, but I've found especially with debugging, if I come across
a section of code that ended up misleading me as to its purpose, then a
comment definitely goes in there.

Another rule: comment as you go.  Good intentions are all very well, but
human nature is such that you know you're never actually going to go
back to that bit of code and stick the comments in "later", no matter
how much you intend to do so.

Well-named variables are good too; they can reduce the need for a
comment explaining the purpose of the variable.

Kathryn Andersen
-=-=-=-=-=-=-=-=-
You can't cross a large chasm in two small jumps.
-- 
 _--_|\     | Kathryn Andersen	<http://www.katspace.com>
/      \    | 
\_.--.*/    | GenFicCrit mailing list <http://www.katspace.com/gen_fic_crit/>
      v     | 
------------| Melbourne -> Victoria -> Australia -> Southern Hemisphere
Maranatha!  |	-> Earth -> Sol -> Milky Way Galaxy -> Universe



More information about the Programming mailing list