Are most programmers male?

Peter Hansen peter at engcorp.com
Tue Aug 13 22:35:47 EDT 2002


brueckd at tbye.com wrote:
> 
> On Tue, 13 Aug 2002, Peter Hansen wrote:
> > I've found that when code is developed test-first, it is rarely tempting
> > to rewrite old code.  In fact, I consider code developed test-first to be
> > a _real_ asset, rather than just some lines of text someone wrote that is
> > cluttering up random folders on his hard drive after he left.  Other
> > code does not seem to have so much intrinsic worth.
> 
> Hmm... that's interesting. In most of the cases I've seen, whether or not
> the code was developed test-first has had *nothing* to do with the
> temptation to rewrite it (the few exceptions were when in addition to no
> tests the code was just plain horrible, in which case there tended to be
> deeper problems).
> 
> Instead the drive comes mostly from the evolution and clarification of
> business needs - additional features are needed or the need can be better
> described with each new version of the program.

I agree.  I didn't mean to discuss where the temptation itself comes from.
I mean to point out that with code not developed test-first, there is a
stronger likelihood the code either has poor test coverage, or is very 
poorly written, or both, and in such cases even if there would otherwise
be a strong temptation to stay with the code and modify it, rewriting it
from scratch seems to be the only real option.  With test-first code,
neither of these things tends to happen, and you don't get that "just plain
horrible" code, so you have no urge to rewrite it but are willing to 
work with it as is, extending it as you describe, in an evolutionary way. 

> In terms of new features, you always need to strike the right balance

I also agree with everything else you wrote. :)

-Peter



More information about the Python-list mailing list