Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • by ziggy (25) on 2005.07.28 11:00 (#42204) Journal
    I take two steps when taking over some legacy code:
    1. Delete all the comments
    2. Normalize the formatting, including vertical whitespace
    It works well enough when you're starting out on an existing codebase. At the end of the day, 3-year old (and incomplete) edit histories aren't that important, and commentary on why something changed into its current state is useless, because you're not likely to see the conditions that triggered the change way back when.

    Additionally, focusing on just the code helps you focus on the problem. Usually, projects like this have overly verbose idioms and massively over-engineered complicated logic. Once you start teasing out those idioms and logic, and replace them with something easier to read, the amount of code starts to shrink drastically. (You are testing against a regression test, and using version control, aren't you? ;-)

    Interestingly, I picked up this pattern when working on a large FORTRAN codebase, where everyone commented out code and copied the old source into an archive directory before committing a change. When these antipatterns get out of hand, extreme measures are the quickest way to restore your sanity.