This blog is essentially a journey of self discovery arriving at https://sandimetz.com/blog/2016/1/20/the-wrong-abstraction "duplication is far cheaper than the wrong abstraction."
The thing I hate most is when some creates the "new way of doing things". Then fails to convert most of the existing code which is "doing things the old way" even when it's clear that it is the same thing.
Goodbye, Clean Code (2020)
81–90 of 224 posts
Re: Goodbye, Clean Code (2020)
#82Having duplication does not mean your code is not clean. Sometimes, having duplication is actually cleaner, and easier to understand. Removing duplication may introduce complexities, and force developers to untangle the additional logic that was introduced to remove dupes. Good duplication means code just happened to be the same in a few places (but it can be potentially different). It's fine and easy to read. On the…
Would you go with a simple comment/tag to denote both piece of code are identical but not abstracted away on purpose ?
Re: Goodbye, Clean Code (2020)
#83Earlier quoted context omitted.
And yet, at least for the quoted part, he is right. It requires some massive balls to deploy code to production while not even seeing if it works for any case. If the answer to "how do you know it works?" is "trust my judgement bro" then I will not, in fact, trust their judgement. I do agree he has a finger in the zealotry and he should probably have modulated how he expressed himself.
You know, they sent people to the moon using software written before the unit test paradigm.
Re: Goodbye, Clean Code (2020)
#84Earlier quoted context omitted.
Years ago (2005?) I worked at a call center. Most agents were on one coast - data center was in another coast. Agents in our call center complained about speed. When they'd pull up an account, it was taking seconds... sometimes 15-20 seconds... to pull up the account. This was all a bespoke CRM system. I poked in the code (it was something I had access to) and noticed that ... the entirety of the whole screen was dup…
You mailed the original developer, he didn't answer. And you were fired for doing your job right. What you must conclude is that they don't care about quality but about ego. They have a philosophy that don't favor quality. You should be glad they fired you.
Re: Goodbye, Clean Code (2020)
#85I'm shocked that from all discussion nobody noted the root of all evil: "It was already late at night (I got carried away). I checked in my refactoring to master and went to bed, proud of how I untangled my colleague’s messy code." No PR, no code review, no CI. Just a cowboy pushing to the master..
Re: Goodbye, Clean Code (2020)
#86Earlier quoted context omitted.
The other developer usually has reasons why they designed it that way. If you just rewrite other people's code, it makes it seem like you think there is One True Way to writing code and that you're smarter than them. I'd ask first if they agree with a certain improvement. It shows I value them as an engineer and they might bring up critical information that I'm missing, making my "improvement" actually worse. It does…
I just assume that they got one pass at it. Agile!!
Re: Goodbye, Clean Code (2020)
#87A lot of bad refactoring is sort of like putting Chair as a subclass of Dog because both have four legs. Or someone thinking that long paragraphs have high cognitive load, so all paragraphs are split into 2-3 lines.
In this scenario, OP simply changed the code without understanding what problem it was meant to solve. It's not about trading readability for flexibility, or respect or anything. It's that the code was probably further from solving the problem.
Re: Goodbye, Clean Code (2020)
#88Earlier quoted context omitted.
You know, they sent people to the moon using software written before the unit test paradigm.
Way, way back in the day, one of the best applications I've ever written had no tests. That application is probably in use today, in fact, even though its life is measured in decades. My takeaway is that tests are important, but good code is still more important.
Just because Uncle Bob, seller of unit testing software and TDD-books will hear of no other doesn't mean that this is the One True Way.
Re: Goodbye, Clean Code (2020)
#89This blog is essentially a journey of self discovery arriving at https://sandimetz.com/blog/2016/1/20/the-wrong-abstraction "duplication is far cheaper than the wrong abstraction."
The thing I hate most is when some creates the "new way of doing things". Then fails to convert most of the existing code which is "doing things the old way" even when it's clear that it is the same thing.
Re: Goodbye, Clean Code (2020)
#90The famous book about Clean Code was a big Oxymoron, because the examples in it pages was in Java.