• Welcome to Valhalla Legends Archive.
 

Maintaining Code

Started by iago, January 28, 2004, 09:33 PM

Previous topic - Next topic

iago

Since I've been working at a job, I have a huge pile of code to maintain.  It was written over the course of four months by a pair of fellow students who aren't there anymore (they finished their term and went back to school).  

Anyway, there is a lot of terribly written code there.  A lot of it is at the point that I want to rewrite it.  If I make one change, everything falls apart.

There is a class for uploading files.. basically, the file is passed to a remote computer as an array of bytes.  The problem is, when the remote class is initialized, the user's id and base path are stored there, and read from there all over a different part of the program which has very little to do with that class.  I spent about 5 hours today trying to get rid of storing the basepath in the class,and I gave up and restored my backup.

It pains me to have code like that, but it would take me days to rewrite it.  What do others who have this task normally do?
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


Thing

I hire a programmer to do it for me.
That sucking sound you hear is my bandwidth.

effect

#2
iago , i am in the EXACT same situation as you are my friend , i thought about this for a little while then came to the conclusiong that it would be a waste of my time to try and re-code the whole achitechture so i just go along with my pre-desessor's crappy code / modyfying / deleting it accordingly.

there is a threshold where there code becomes to obsolete to build on then u find yourself in a pickle of a dickle. Either finding something that WILL work with their code or like i said re-do the whole achitechture.
Quote from: Mangix on March 22, 2005, 03:03 AM
i am an expert Stealthbot VBScript. Recognize Bitch.

Adron

I agree with NuLL. Do whichever is most efficient for you. Estimate how long it would take to recode/reimplement it in a better way. Estimate how much time you could save on maintenance having it reimplemented like that. If it's mostly an issue of the way it looks, leave it. You should consider the risk of bugs though.

iago

I'm thinking.. they have a 600 line file which does all sorts of file stuff, plus lots of other stuff.  If we can make a seperate class for file i/o, we can probably cut that file in half and clean it up a lot.  I'm going to look into that one today :/


Thing - That's what they did.  And that's who I am :)
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*