[lug] Re: recycling code [WAS Fwd: NICHOLAS PETRELEY: "The Open Source" ]

rm at mamma.varadinet.de rm at mamma.varadinet.de
Thu Mar 22 16:24:26 MST 2001


On Thu, Mar 22, 2001 at 05:09:59PM -0700, Scott A. Herod wrote:
> I wanted to throw my "Amen" in.
> 
> I wish that on Friday I had started re-writing the code I'm working
> on now rather than just trying to use an existing Open Source project.
> I'd be done now rather than trying to figure out why an undocumented,
> 500 line routine which has as its only white space, tabs and CRs, 
> contains about 30 non-documented global variables, and which consists
> of little more than "grep" can manage not to be reentrant.

Only a week? Lucky you. We spent the last three month over
other's code. Buggy harvest to begin with, nicely wrapped
up in two huge perl cgi scripts written by a _very_ eloquent
perl programmer (-> highly idiomatic) that was "kept running"
by Perl beginners for the last two years. Since the didn't 
understand half of the code they just added to it. Never touch
anything, never remove a line of code. Whe i first loged into 
the websever there where about 100 nearly identical copies of
the same cgi ...
We got the project because the whole thing would stop working
once a week (management solution: we need to move this to a
more powerfull server ..).
I have to admit that the first few weeks where highly
entertaining--poke somewhere and see what happens ...

Having a good toolchest is one of my secrets for living
through something like this. A good cross-referencer/indexer
can make the change (hypersrc, Code Navigator, Sniff++ etc.)
I also have a bundle of code archeology script/elisp code
to analyze and prettyprint old code. But still: it can be a pain.

 Ralf



> Scott

> 
> rm at mamma.varadinet.de wrote:
> > 
> > Two remarks: no, in theory one doesn't have to rewrite from scratch.
> > BUT: you have to admit that it's much harder to read a lot of
> > 'foreign' code then to rewrite certain code from scratch. In an
> > ideal world the existing code would be:
> > 
> >  - well written, meaning written to be understandable
> >  - well documented
> >  - constantly maintained. 
> 
> <snip>
> 
> >    Have you seen the number of zombie projects on sourceforge?
> > 
> > As harsh as it might sound, often rewriting is much more easy
> > than code fixup.
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug



More information about the LUG mailing list