Death March

November 5th, 2004 § 2 comments

I guess every programmer was once part of a Death March project. Here in Brazil, I think Death March projects are the norm, given the common tendencies of managers to underestimate the time it takes to develop applications, and the huge competition caused by restricted markets in some cities. Consequently, things fail, mistakes are made, and delays accumulate.

Today, I finally left this stage in a project I’ve been working on, and I can now believe the situation is under control. The last three weeks were a chaotic mix of long hours, little sleep, and too much despairing. The extended holiday I was dreaming of disappeared amidst unending lines of code.

This project, to tell the truth, wasn’t that big. But internal flaws magnified the problems, and incorrect decisions about them let the application in a brittle state where it was unable to cope with some scenarios it was intended to deal with.

The only solution was refactoring, which was what I did. Code endlessly reproduced all over the application by way of Copy & Paste Programming was refactored into methods. 800-line long methods were trimmed to 50 lines or less by the use of strategic sub-routines. In two weeks, the code stopped looking like a mess, and became readable. I finally believed things would work out well in the long run.

So the story has a happy ending because the client tested the system and, except for a couple misunderstandings, the code worked. No show-stopper and no inconsistencies. And I lived for another day.

§ 2 Responses to Death March"

  • Kev Spencer says:

    A long lost relative of the CopyAndPasteProgrammer is the CargoCultProgrammer (http://en.wikipedia.org/wiki/Cargo_cult_programming). Just recently I had to modify an old Perl module and was literally horrified at the number of other modules that were brought in that had absolutely *nothing* to do with the task at hand. A former coworker thought it was a good idea to just add these libraries because he thought they might be needed. His “# just in case” comment in the code made me cringe. Don’t you know if they’re needed or not? Yipes, gives me the willies just thinking about it :-)

  • Ronaldo says:

    That reminds me of a problem some of the ASP-based systems I used to maintain when I first came to the company I work today.

    There was a function call that took three integer parameters that varied according to the database mode you wanted the call to run. If you modified the database schema, the calls started to fail consistently. Then people found out that if you changed two of those parameters in a call, you could make the system work again.

    As far as people studied the question, it was determined that the call caused the database driver to flush its definitions and load them again, but nobody could precise the exact conditions in which the call needed to be made. So people just change random pages and called them until the problem disappeared. Talk about cargo cultists… 😛

    Of course, when I took over the systems, I got rid of all those calls refactoring them in more reliable methods.

What's this?

You are currently reading Death March at Reflective Surface.

meta