Some people label things they don't understand as being too complex. When you ask them what they are doing instead, their answers are often as complex, with one major difference. They understand it.
Comments
Log in with your Bluesky account to leave a comment
I think that's why people prefer to refactor/recreate. They think something is badly implemented or overly complex. But really they often just don't understand it and if they make it themselves, they'll understand it.
I enforce Chesterton's Fence in codebases I administer: you're not allowed to change or remove something until you can explain why it's there in the first place and give a convincing account of why that rationale is no longer needed
It's not about the quality of the original codebase, it's about the principle. It's an important habit of mind to maintain. Working code, even inept working code, is still there for a reason
If you don’t understand, you can’t create tests to guarantee that your replacement does the same job or that removing doesn’t break something. If the tests are already there and passing, you don’t need to fix anything.
Consider the situation where there are no tests, the code doesn't do what it's supposed to do, there are no docs, and the work was outsourced to a company that had it's contract cancelled because it was so bad.
I am in the same boat, currently. The original code is so bad you could be excused for thinking it was active sabotage. Every change is a dance in the minefield. We really tried working with it but after months of running in circles it was time to cut losses. No regrets.
My experience is that people reinvent/refactor because they think they’re smarter. After sweeping out the old they learn that there were elements of a system they didn’t understand and often still don’t. They didn’t grasp that complex systems evolve from simpler systems.
All good points. But in my experience, the act of *trying* to refactor more often than not leads to deeper understanding of the original code than before. And that can inform the decision to cancel the refactoring (and it sometimes does) or change the refactoring approach. So I think to try is good.
I’d agree with that.
I think perhaps it isn’t refactoring so much as “we need to replace all this” that I am hearing. I’ve had a lot of people say refactor when they meant wholesale replacement and my interpretation immediately goes there.
One of the “best practices” in database engineering where you have a long lived and relatively stable code base is to re-factor 5 to 10% of your code annually. You can tell when a company has not done this, and eventually they have a major engineering overhaul to do.
Anecdotally, i’ve noticed over the years that well-commented code which explains *why it’s doing what it’s doing* and is therefore understandable tends to stick around longer in a code base than code with zero comments.
Don’t you think the folks who wrote it should take some responsibility for leaving things in am understandable state? Because yes, I think software should be rewritten over and over until the internals make sense. If the rewrite lands you in the same mess, didn’t document enough in the process
slightly complicated by the fact that all too often kubernetes IS too complex for the job at that point in time, landing you in a "run before you can walk" situation
you can only truly appreciate what it gives you if you tried without it, went too far and then you introduce it, what a relief
You've just put into words a thing that's been ringing in my head for years. As a trainer, I always try to remember how complicated everything seems when you don't understand it yet.
Starting to see this a lot lately, it's really frustrating, learning to pick battles though - when someone is in that mindset it's a tough sell to spend energy on it
Oh yeah... I see staff engineers make this mistake all the time, I think because they have less time than their teammates and therefore less patience for different ideas...
This is why Ansible saw more adoption than Puppet.
"An SSH loop with actions controlled by YAML? Oh yeah, this is the kind of hack I could've made myself" is the kind of argument I've heard multiple times from System Engineers...
Comments
https://bsky.app/profile/liamblizard.bsky.social/post/3l7aw43tnko24
I think perhaps it isn’t refactoring so much as “we need to replace all this” that I am hearing. I’ve had a lot of people say refactor when they meant wholesale replacement and my interpretation immediately goes there.
"Either the person who wrote this is an idiot or I am"
No one realizes how complex their solution is until it’s seen from an uninitiated observer that didn’t see it start out simple.
you can only truly appreciate what it gives you if you tried without it, went too far and then you introduce it, what a relief
(Obviously you understand better what you refactored it into … how could you not?)
I wrote a blog post about this for code, a while back:
https://jakeout.com/posts/2024-03-13-simple-code
I view it as a valid solution to many problems with similar time / money / resources limitations.
Right up to the point where your expert engineer is no longer available.
"An SSH loop with actions controlled by YAML? Oh yeah, this is the kind of hack I could've made myself" is the kind of argument I've heard multiple times from System Engineers...