in reply to Best way to fix a broken but functional program?
Having read it, you might have noticed duplications or near duplications. There's your chance to factor out common code into subroutines. This also allows you better encapsulation -- you can use lexicals instead of globals, passing in and receiving data. The program will get shorter and shorter, as you do this.
Based on my experiences reworking File::Find (soon, soon), you may be able to cut out 25% or more of the code.
(Extra free advice: wouldn't it be nice if this old code had unit tests, so you could change things and verify it still performed as expected? Someday, your code will be maintained. Make life easier for someone else.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Best way to fix a broken but functional program?
by idnopheq (Chaplain) on Aug 22, 2001 at 22:47 UTC |