Skip to content

Comment on Ask HN: I just inherited 700K+ lines of bad PHP. Advice?

Comments

But what do you have to do with that? Is it maintenance? Do you need to fix bugs?

If 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.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.