Your description is accurate. No need for that /s
Your description is accurate. No need for that /s
What I’m saying is that it’s hiding too much of the control flow.
Compare it with this code:
public double calculateCommision(Sale sale, Contract contract) {
double defaultCommision = calculateDefaultCommision(sale);
double extraCommision = calculateExtraCommision(sale, contract);
return defaultCommision + extraCommision;
}
This is about the same number of lines, but it communicates so much more about the control flow. It gives us an idea which data is involved in the calculations, and where we can find the result of all the calculations. We can make assumptions that the functions inside are independent from each other, and that they’re probably not relying on side effects.
This is also against clean code examples, because Uncle Bob seems to be allergic against function arguments and return values.
Academia has a disconnect with the industry when it comes to coding practices. Most teachers haven’t much industry experience. They don’t know how it is to maintain a 10 year old project using SOLID and clean code principles.
They just teach whatever has already been in the curriculum for decades. They don’t know that whatever they’re teaching is actually harmful in the industry.
It’s abstract art!
I heavily disagree it’s easier to write good code if you follow clean code. Especially if you follow his examples throughout the book. Most of his examples are just over engineered messes held together by side effects (even if he says side effects is a bad thing).
If he can’t write good code by following clean code, why should you? He even picked the examples himself and failed!
These kind methods hide too much.
Where can I find the commissions these methods calculated? Does extra commissions depend on the calculations of default commissions? Do I need to calculate default commissions before calling hasExtraCommisions? What happens if I calculate extra commissions if hasExtraCommisions return false?
There are so many questions about this code that should be immediately obvious, but isn’t.
The article goes into that. Clean Code has some good advice. But it also got bad advice.
Problem is, the good advice is basic. Anyone working in the industry will pick most of these up. All the good advice could be summed up in 10 pages or so.
The bad advice is incredibly bad - and in the worst cases even be counter productive. A newbie won’t be able to tell these advice apart. Some professionals might not either. So they adopt these techniques to their code, and slowly their code turns into an unmaintainable mess of spaghetti.
So no, the book shouldn’t be recommended to anybody. It has already done enough harm to the industry.
Robert Martin’s “Clean Code” is an incredibly useful book which helps write code that Fits In Your Head
It has the exact opposite effect. It leads to code that doesn’t fit in your head.
Because his style of coding leads to code where everything useful are 10 levels deep in nested method calls. If I want to understand how the code works and how my changes will affect the overall picture, I need to keep a dozen methods in my head and how all of these are connected to each other.
And he’s mostly working with global states, so knowing where variables are assigned is just a huge pain.
So many times I’ve looked into code like this where I finally find what I’m looking for, only to forget how I even reached this part of the code. So I need to backtrack to remember how I got there, but then I forget where that damn thing I was looking for is. And I go back and forth until I figure out a mental model of the code. It’s awful!
Compare that with just having one big method. Everything is in front of me. I don’t need to keep that many things in my head at the same time, because everything I need is right there in front of my eyes.
Sure, sometimes breaking out to separate methods can make it easier to communicate what the code does and the boundaries of each scope, but if it’s overdone it leads to code that’s impossible to work with.
It’s generally considered a fact that Linux, along with many other open-source software projects, are more efficient than their propriety closed-source counterparts
This is not necessarily true. Linux had trouble with Nvidia Optimus, which is a GPU technology that seamlessly switches between power modes. Well, that is if it works properly, which it didn’t for Linux. I haven’t heard it in a while, so I assume it’s not a problem now anymore.
But it was a big problem where Linux laptops drained batteries much faster because they were using the GPUs at max capacity at all times.
What I’m saying is that the efficiency of Linux depends on access to hardware features, and that might depend on the vendors of the drivers.
Also, like it or not, if there’s one thing I envy about Mac is its power efficiency. They usually last really long on one charge.
Well, that as well, but it’s an also bit tricky to safely check if a number is even because JavaScript uses floats for numbers.
The popularity of these two packages shows that something is very wrong with JavaScript.
Red carton is chosen because that’s how it’s commonly depicted in cartoon images.
https://duckduckgo.com/?q=french+fries+cartoon&t=h_&iar=images&iax=images&ia=images
Most programming doesn’t need math or algorithms. Sometimes it’s needed. For example, 3D programming involves lots of mathematical geometry. It’s difficult to solve these problems without mathematical knowledge.
Maths and algorithms are useful tools to make certain problems easier to make sense of.
Unicode Consortium decide which emoji should be included. It’s up to each vendor themselves to come up with how they should look like. I don’t think Unicode Consortium explicitly state it must look like McDonald’s fries.
https://unicode.org/emoji/proposals.html#Faulty_Comparison
The existence of other emoji can’t justify the inclusion of a new emoji. Those emojis are old, and it’s unlikely they would’ve been approved under Unicode’s current guidelines.
The logo and name is the brand. How do you visually represent a specific payment protocol without using its logo? There’s no emoji for HTTP or TCP either.
The problem with having cryptocurrency as emoji is agreeing on the specification how it should be drawn, and also make it different enough from already existing emojis such as coin 🪙. It is not exactly a tangible thing.
It probably falls under faulty comparison:
https://unicode.org/emoji/proposals.html#Faulty_Comparison
Their guidelines change, and it’s possible these emoji were added with old guidelines. They can’t remove old emoji, which means specific buildings like Tokyo Tower🗼is an emoji, even if they prohibit the addition of specific buildings nowadays.
https://unicode.org/emoji/proposals.html#Faulty_Comparison
The Tokyo Tower🗼(a specific building) does not justify adding the Eiffel Tower.
Many historical emoji violate current factors for inclusion. Once an emoji is encoded it cannot be removed from the Unicode Standard.
It was added when Unicode Consortium had different guidelines. They don’t accept specific buildings anymore.
Under automatically declined:
Specific buildings, structures, landmarks, or other locations, whether fictional, historic, or modern.
There’s no profits in this.