

I've inherited 200K lines of spaghetti code — what now? - bussetta
http://programmers.stackexchange.com/questions/155488/ive-inherited-200k-lines-of-spaghetti-code-what-now

======
pasbesoin
Image and archive the extant system. In triplicate, including off-site. (Don't
assume anything you're told about existing backups is correct / correctly and
safely executed.)

Select and teach them version control. You want to be able to document and
roll back changes made from this point forward. Mantra: "First, do no
(irreversible) harm."

This code base will contain knowledge/configuration from people who are no
longer accessible. Even the current experts might have to expend considerable
time and effort in trying to recreate some of it and/or and understanding of
those parts specifically.

So, you aren't just going to rewrite it. A first step, aside from ongoing
work, would be to _document_ it.

Some of the people you are working for are going to want to _get on with
things_. A primary focus in your education might/should be to make them read
some of the better documented cases of such systems "blowing up" -- 'the bug
that ate Rochester', and the like. Convince them that _now_ is the time for
some risk management, while their luck (hopefully) holds.

Once you/they know what you have, some of those "best practices" may make more
sense and sink in better when they can be applied to something that they
actually, specifically, and directly care about.

Did I mention, version control?

Oh, and establish from the start that you are the expert in this, and that
this is _your_ job. Some egos are likely to try to push you around, unless and
until you push back sufficiently well.

------
polysaturate
Framework sauce...maybe some MVC-balls?

