Hacker News new | ask | show | jobs
by cjfd 2033 days ago
I think the all or nothing view may be the problem 'maintain spaghetti code' vs 'clean/new code'. When one inherits a code base like that one should start small. Write an automated test that tests a single scenario, add a comment that explains something particularly difficult that a developer spent a lot of time on finding out. Rename one single variable somewhere. Then gradually as one gains more knowledge start doing bigger refactors and bring more of the code under tests. It sounds like what has happened here is that a big bang rewrite was undertaken. This is almost always ill-advised.
2 comments

I like to use the model that humans can only grasp so much, and that only increases slowly if at all, so on a mature project you have to try to keep the amount of stuff to remember constant. New code that adds new concepts needs to be counterbalanced by simplifying things elsewhere. As the inherent complexity increases, chip away at the accidental.

I sweeten the pot with management by pointing out that if you do this, it’s easier to ramp up new people. If you can ramp up new people, you can absorb new customers without making a fool of yourself in the process. We should want to be able to take on big new customers, right?

Thank you for explaining much more clearly and succinctly than me.