in reply to Strategies for maintenance of horrible code?
Yes, it would have been cheaper and faster to throw this code away and start overMaybe. For another point of view, see Joel Spolsky on not rewriting from scratch.
I agree with adrianh. If a component is not broken, don't rewrite it. Rewrite a component when you find a number of bugs in it. But first write a regression test suite for the component. I've seen many folks over the years throw out old code, rewrite it ... and introduce a heap of new bugs in the process. If you come into a new company and introduce a swag of new bugs in previously working code, you will start to smell very badly.
- Swallowing an elephant in 10 easy steps by ELISHEVA (Describes how she tackles big problems to keep moving forward rather than going around in circles)
- Dealing with sloppy code
- Becoming familiar with a too-big codebase?
- Analyzing large Perl code base.
- Perl Medic: Transforming Legacy Code by Peter J. Scott
- Working Effectively with Legacy Code by Michael Feathers
- Object-oriented Reengineering Patterns book now available as a free download
- Nobody Expects the Agile Imposition (Part VI): Architecture (discusses refactoring vs rewriting of very large code bases)
- The Boy Scout Rule (apply the Boy Scout rule of "leave the campground cleaner than when you found it" to your code)
- Unix shell versus Perl (explains why Perl is a better choice for large code bases than Unix shell)
Update: Legacy Code References Added Later
- Backdating strict
- sed/awk/grep to Perl
- Working with old code
- Splitting program into modules
- Searching for duplication in legacy code
- Perl archeology: Need help in refactoring of old Perl code that does not use strict
- Reading Someone's Program
- Code Structure Changes
- Perl Elitist Code vs Functional Code
- Meaning of "Clean" Perl code
- How to retain perl in-house code
- documentation best practices for internal modules
Update: Testing References Added Later
- Re: Winning people over to better development practises (TDD)
- Effective Automated Testing
- What is the best way to add tests to existing code?
- Looking for help for unit tests and code coverage on an existing perl script
- Needing help on testing
- How do you test end-user scripts?
- A brief question about testing/best practices
- How to write testable command line script?
Updated: Added many extra references long after the original response was made.