I would talk to the client about focusing your effort on helping them transition--a small piece at time--to a sane architecture. If they aren't open to that, they aren't your client. I've been a business leader in a position where we had to make really tough and painful decisions about coding projects gone awry. I don't envy their position, but continuing forward with this monster does not seem to be in the long-term interests of the company.
Ask HN: I just inherited 700K+ lines of bad PHP. Advice?
11–20 of 78 posts
Re: Ask HN: I just inherited 700K+ lines of bad PHP. Advice?
#12If it's maintenance/bug fix, I'd suggest starting by writing tests and fixing things on a day to day basis.
So, for all small tasks that you'll have to do with the code base, just analyse the safest way to tweak it. Most often than not, you'll see that it's just changing a couple lines. If you need to add new features, just code them correctly in another part of the program.
And before you know, you'll understand the code-base. But, tests are really the most important thing here. Don't try to refactor if you can't make sure you're not breaking everything.
Re: Ask HN: I just inherited 700K+ lines of bad PHP. Advice?
#13Re: Ask HN: I just inherited 700K+ lines of bad PHP. Advice?
#14Personally if I were in your position I would explain to the client that I'm happy to temporarily fix some bugs but long term the system needs to be rewritten. 700k lines of code is a lot, but the way you've described it I get the feeling most of that code is needless. Depending on what the system actually does you could conceivably rebuild in a few months.
Re: Ask HN: I just inherited 700K+ lines of bad PHP. Advice?
#15Re: Ask HN: I just inherited 700K+ lines of bad PHP. Advice?
#16So the cold reality for this client is that the codebase will have to be replaced over time. You are not trying to escape legacy simply for the lure of something new, you are trying to escape insanity. I would talk to the client about focusing your effort on helping them transition--a small piece at time--to a sane architecture. If they aren't open to that, they aren't your client. I've been a business leader in a po…
Re: Ask HN: I just inherited 700K+ lines of bad PHP. Advice?
#17Re: Ask HN: I just inherited 700K+ lines of bad PHP. Advice?
#18The moment you start touching the code, you are going to start being blamed for the nightmare preceding you. It could even affect your career if future employment researches where you worked previously and gets told you made the mess in the first place.