Discussion about this post

User's avatar
Natasha Jaffe's avatar

I really, really like this post and think it should be required reading for any team looking to do a refactor or, even scarier, a rewrite:

https://fffej.substack.com/p/technical-debt-as-organizational

The opening paragraph reminds me of Joel Spolsky's article, here: https://www.joelonsoftware.com/2000/04/06/things-you-should-never-do-part-i/ .

I'm also reminded of the book, Working Effectively with Legacy Code, by Michael Feathers. In particular I think about the utility of pinning tests (tests that you write to reflect the current behavior of a system that you don't understand) and no-change refactors (extracting helper functions etc.)

My one battle scar worth sharing here is to beware of the latter - no-change refactors - that might not be so no-change after all. I saw a really bad thing happen when an engineer pulled out a function by hand and ignored a parameter that should have been passed by reference instead of by value. The moral of that story was to 1) understand what the code is doing and why (like Jeff argues) 2) implement a pinning test if you don't and 3) use the IDE's built in refactoring functionality every time.

Mr Mark T Jackson's avatar

Really good article. I thought I was good at figuring out old code but I never thought of data mining the git history!

The article reminded me of an Amazon engineering tenet that I like to quote sometimes: "respect what came before"

It comes with this justification "Principal engineers are grateful to our predecessors. We appreciate the value of working systems and the lessons they embody. We understand that many problems are not essentially new."

No posts

Ready for more?