3 ms·
> Inherited code is considered guilty until proven innocent. Or maybe more accurately, guilty until you've rewritten it. I'm facing this dilemma right now, and
by pacala 11y ago
> Inherited code is considered guilty until proven innocent. Or maybe more accurately, guilty until you've rewritten it.
I'm facing this dilemma right now, and I find it a whole lot more nuanced. The previous dev definitely had the right ideas, but he also produced XXXXX lines of code. I would take me years to wrap my head around the reasons for all these lines. Is this a bug or a feature? It would take me weeks to rewrite it, drop 75% of the corner cases for which I have no test case / clue why they have been coded. Then become the grumpy old dev that says "no" to 95% of feature requests and keep things simple. At the risk of my job.
- swanson 11y agoYou might find value in exploring the idea of Characterization Tests or Software Seams.
- steveklabnik 11y agoor Working Effectively with Legacy Software.
- arnorhs 11y agoOften the reason can also be evolution. Where the code started off doing something specific - but then as it evolved, more features were added, approaches changed, the code evolved to do something totally different. Also "starters" - people who are good with getting something shippable fast and iterating on features and not the same people as the ones that write truly great code - simply b/c they're driven by different things. But it's very situational.