Learning and Maintaining a Large Inherited Codebase? 532
An anonymous reader writes "A couple of times in my career, I've inherited a fairly large (30-40 thousand lines) collection of code. The original authors knew it because they wrote it; I didn't, and I don't. I spend a huge amount of time finding the right place to make a change, far more than I do changing anything. How would you learn such a big hunk of code? And how discouraged should I be that I can't seem to 'get' this code as well as the original developers?"
It depends on the language (Score:5, Funny)
Hunt down the original developer (Score:5, Funny)
(And then shoot him.)
Re:30 to 40 thousand lines isn't large by any meas (Score:5, Funny)
Very well, sir. Here's your 40,000 lines of Perl from the late 90s. It's mostly regex to parse revisions 30 through 451 of our in-house provisioning system. Oh, and BTW don't screw up like the last guy who had this job. He provisioned 32767 customers with tier-1 service, and it was the director's job to explain why we either had to let them have it for the remainder of the year, or else deal with the CR issues.
You don't. You find out what the software did (Score:5, Funny)
And then you re-implement it in the latest language.
Re:You are an idiot (Score:2, Funny)
yeah, the clown always creeped me out as well.
Re:You are an idiot (Score:0, Funny)
IBM paies me 2 Mexican paysos for every line of code I fix that American coder screw up and I need food and room like American does. If American wants money than American should do job correct the first time and not have to send it to INdia to get all the work done correct. As AMerican teenager say DONT HATE THE PLAYER HATE THE GAME
Done that.. (Score:3, Funny)
As someone who recently passed off a pile of code of about that size in poorly written and poorly documented php to someone.. All I can say is I'm very very sorry, and I had *no idea* my personal side project would work better than the original commercial offering and be declared 'mission critical' three months before I left for greener pastures..
Re:Hunt down the original developer (Score:5, Funny)
Re:30 to 40 thousand lines isn't large by any meas (Score:5, Funny)
Perl is like the matrix. At a certain point, after you've stared at it long enough, it all just makes sense.
Re:It depends on the language (Score:5, Funny)
No, he meant that as an actual offering to the Perl God, Quetzal$@[&shift]L. It's a bloodthirsty god, who never sends the Divine Debugger without at least two pints of the red stuff. I would have immolated a coworker, but the parent poster seems to have been alone in the room :-/
The fact the above comment is +5 Informative and not +5 Funny makes me very glad I stopped programming in Perl when I did.
Re:30 to 40 thousand lines isn't large by any meas (Score:3, Funny)
Seeing software problems in terms of Flying Spaghetti Monsters? Ah, so that's where the "spaghetti code [wikipedia.org]" term comes from!
Re:Not lots of code (Score:3, Funny)
so like... perl?
More percisely 30-40,000 lines of code is 29,999-39,999 times more lines than one needs to write shitty code...
Re:Hope your management understands (Score:3, Funny)
I inherited some code where the developer used names of girlfriends in variable names, it was just dumb and completely unprofessional.
I once inherited a coding project where the naming conventions involved anti-depressant, anti-anxiety, and sleeping drugs. Let me tell you, that's a fun preview of how one's future working on the project might turn out.