Popular Programming Book "Clean Code" is being rewritten
Popular Programming Book "Clean Code" is being rewritten
Those who know, know.
Popular Programming Book "Clean Code" is being rewritten
Those who know, know.
But is it rewritten in Rust?
It'll be rewritten in mdBook
Closure! (I don't think so, not many programmers like reading/writing functional code. But it is his current favorite language, so, who knows?)
I should get to work on my opus, "Dirty Code"
Inside I'll reveal all my secrets like: not writing tests, not documenting anything, putting the whole app into a single python file, object-disoriented relational mapping, obscure SQL tricks, unobscure no-sql tricks, and more!
object-disoriented
I'll steal this to shit talk about code; until git blame points to my past self
Github, but it's afraid of commitment, it just wants to spoon.
Just make sure the first chapter is dedicated to spaghetti, and contains various GOTO statements telling where the reader where to go shove it and other obscenities.
I hope your book won't have a table of context and those stupid indexes. If they read it, they should know where you mention topics, right? Tables of contents considered harmful! /s
I like "how to build APIs you won't hate".
I hope the tricks are only supported on kafka's ksql.
I read a book like this once! It was like, "how to code badly."
It was actually kinda fun.
I'm of the opinion that Uncle Bob did some massive damage to software development as a whole with that book.
With that said, this is genuinely funny.
Agreed. I found that many developers, in the pursuit of clean code, lost slight of some of the fundamentals principles of good code. I found that people were eschewing readability and modularity and calling it clean code.
Clean code became the target, not the underlying principles and the reason why we needed clean code in the first place. It became an entirely new thing that aided in producing some of the worst code I've read.
Oftentimes, when devs talk about "clean code" it's a red flag for me in hiring. Some of the worst devs I've worked with have been clean code evangelists.
I'm beginning to feel we're no longer talking about Clean Code being bad, but about people following ideas they don't understand, which is not related or caused to any particular book.
I'd love to learn what that damage was. I often see complaints (sometimes also involving tech choices) but usually they're not specific, so I'm always left wondering.
I've found it's mostly two things: readability (ironically) and performance. I'll describe a few crude examples, but I won't get too much into specifics, otherwise I might as well write another book myself.
The performance part is simple: its excessive reliance on polymorphism and the presence of several levels of abstraction just doesn't allow for good code generation. I've seen 10x+ performance improvements by dropping all of the above, with often minimal loss in readability; on the contrary, oftentimes the code became more readable as well.
The readability part is harder to explain; not only because it depends on the codebase and the problem at hand, but also on the coding style each programmer has (though in my opinion, in that particular case it's the programmer's problem, not the codebase's).
I like to think of codebases as puzzles. To understand a codebase, you need to piece together said puzzle. What I've found with Clean Code codebases is that each piece of the puzzle is itself a smaller puzzle to piece together, which isn't ideal.
I generally disagree, not because those ideas are wrong, but because they're often too limiting.
What often happens by following those principles is you end up with a slew of tiny functions scattered around your codebase (or a single file), and you are forced to piece together the behaviour they exhibit when called together. Your code loses locality and, much like with CPU cache locality, your brain has to do extra work to retrieve the information it needs every time it needs to jump somewhere else.
It may work for describing what the code does at a high level, but understanding how it works to make meaningful changes will require a lot more work as a result.
Once again, it makes sense in principle, but in practice it often creates more problems. I agree that having massive chunks of repeated code is bad, no questions about it, but for smaller chunks it may actually be desirable in some circumstances.
By never repeating code, you end up with functions that are over-parameterized to account for all possible uses and combinations that particular code snippet needs to work with. As a result, that code becomes more complex, and the code that calls it does too, because it requires you to know all the right parameters to pass for it to do the right thing.
Exceptions are just bad. They are a separate, hidden control flow that you constantly need to be wary of.
The name itself is a misnomer in my opinion, because they're rarely exceptional: errors are not just common, but an integral part of software development, and they should be treated as such.
Errors as values are much clearer, because they explicitly show that a function may return an error and that it should be handled.
I have lots of gripes with object orientation. Not everything needs to be an object, not everything needs to be polymorphic.
There's no need to have a Base64Decoder
, much less an IBase64Decoder
or an AbstractBase64Decoder
. Base64 only works one way, there are no alternative implementations, a function is enough.
I'm a lot more on the data oriented side of the isle than the OO one, but I digress.
Object orientation can be good in certain contexts, but it's not a silver bullet.
Let's say you have something like this:
Java
class Point { public float X, Y; }
With the Clean Code approach, it magically becomes:
Java
class Point { private float x, y; public float get_x() { return this.x; } public float get_y() { return this.y; } public void set_x(float x) { this.x = x; } public void set_y(float y) { this.y = y; } }
Why? Who the hell knows. It makes absolutely no tangible difference, it only makes your code longer and more verbose. Now, if a value needs validation, sure, but oftentimes this is just done regardless and it drives me insane.
The problem with wanting to create the most generalized code in advance is that you end up stuck in abstraction hell.
You may as well not need the ability to have arbitrary implementations, but now you need to plan for that.
Not only that, but it also makes reasoning about your code harder: how many times have you had to step through your code just to figure out what was being executed | just to figure out what particular concrete class was hiding behind an abstract class reference?
I myself, way too many, and there was often no reason for that.
Also, the idea that you shouldn't know about the implementation is crazy to me. Completely encapsulating data and behaviour not only makes you miss out on important optimizations, but often leads to code bloat.
Take a look at these if you want more info or someone else's view on the matter, I wholeheartedly recommend both:
lol
New edition is just an incoherent rant about the “woke mind virus” trying to destroy him for “just saying what everyone is thinking”.
This! Uncle Bob is a garbage person. Used to really respect him, but F that guy.
I didn’t knew anything about him but I respect everyone who doesn’t shut up in front of the woke agenda and propaganda.
"Code optimization is a cultural Marxist conspiracy!"
I'm a programmer since the 80s, who is this guy?
He wrote for example the books Clean Code and Clean Architecture which are IMO opinion really good books although I don't agree with every point he makes.
Some really good points he makes are for example:
Those comes with examples. He's a tad bit overly idealistic in my opinion. These books fail to mention a couple of things:
All in all though, very solid books. I read Clean Code in university and Clean Architecture in my first job and it really helped me wrap my head around different ways to solve the same problem. Excellent ideas but it's not the holy truth. The only reason I remember all of these points is that I encountered all of them on the job and saw the benefit.
In my opinion new programmers should read it and take inspiration. Craftsman level developers should criticise and maybe pick up a few brain concepts to sort some concepts out in their brain. Experts will get little benefit though.
The consultancy I used to work for in the late 90s would have crucified any developer that didn't write "a data abstraction layer that allows you to pop off the original db and substitute a different one later".
How many times in my 25 year career have I swapped out the database (and been thankful for such an abstraction layer)? 0 times.
I generally agree with the idea that code should be as simple as it can be to accomplish the goal of the code… I just haven’t been convinced that Clean Code is the way to get there, necessarily. The book does contain some good advice , to be sure, but I wouldn’t call it universal by any means.
I also think TDD is a very optimistic strategy that just doesn’t match up with reality terribly often.
Actually, I think that’s what confuses me the most about all of Uncle Bob’s books. I’ve read a couple of them and thought, “All this sounds great but real world development just doesn’t seem to work that way.” Like, all of his advice is for best case scenarios that I certainly haven’t encountered in my career.
I say confusing, because surely he’s been in the profession long enough to have seen the disconnect between what he’s preaching and real life, right???
Wrote a couple famous books about Clean Code, Architecture, Test Driven Development, OOP, and Agile.
he's a programmer since the 70s
Robert C. Martin
Your long lost son, perhaps
There's a multi-part talk on YouTube if you want to hear all about it.
I was a big Uncle Bob fan and still really like the Clean Code book. But he trashed his public reputation so I doubt this 2nd edition will do very well.
Is there a TL;DR if I don't know who this is?
Basically he is an old man/ software engineer who's famous for his philosophy of coding.
I am also a big fan of his books, especially Clean Code. His (far-)right opinions are bad, but should be (to some extent) viewed separately from his technical standpoints. However, even then a new edition would not perform well, there are too many people hating Clean Code (without really understanding its message/just ranting without having read it). But I was very surprised that ThePrimeagen recently interviewed his "opponent", it was very nice to watch.
Working in Ruby did 10x more to help me write clean code than reading Clean Code ever did.
Many of the lessons drilled into me with Ruby (keep a consistent style, tests are cheap, keep your methods relatively small where possible, reduce nesting where possible) carry over nicely into other languages without needing to go through any OO bullshit.
IMO, the best lesson around Clean Code is this: you're not clever, write obvious code that works with as few tricks as possible.
I find this to be true for every new language I try out. Since every language has a different way of doing things and gives me a new perspective, in the long run they all end up improving my programming style as a whole. I always end up integrating the best parts of each into my next project when possible.
Experience will always be more valuable than any set of rules these kind of books tout as "the way things are meant to be done".
oh no somebody stop please him
Ooh la la 😏
i am genuinely waiting for it. read the first one almost 10 years ago and it gave me a good start into my programming journey.
even if this second version won't bring in anything new for me, I will be glad to consume it
Is this the book that introduced SOLID?
no, but the concept was introduced by uncle Bob.
Cleaner Code.
Waiting for him to finish the trilogy with Cleanest Code
cleanerer code. gotta leave room for a fourth book: clean code and the crystal skull
The bit of Clean Code that I read was unimpressive, but Clean Architecture was amazing. I view that book as required reading for anyone who wants to write code professionally. If Uncle Bob hasn't realized that his coding style is worse than alternatives, I do not see how a second version of the same bad ideas is going to do well.
Glad I didn't read it.
There are no inherent "rules" in software development. These books are useless and a waste of time. They offer nothing but CS Dogma and are actually against freedom of expression.
Rules of thumb can be very useful for a relatively inexperienced programmer, and once you understand why they exist you can choose to ignore them when they would get in the way. Clean Code is totally unhinged though
The problem is that a lot of people don't understand when to ignore the rules and just stick with them forever.
We had a developer once that always said KISS KISS KISS whenever we pointed out that her functions are working but not reusable, so she wrote 20 functions that all did the same thing, but with slightly different parameters. And that's just one of the examples
CS often requires working in teams, and working it teams is often more efficient if you have some shared approaches.
There are no inherent “rules” to language, either, but when you don’t followthemthingsgetmessyandyou’reannoyingforeveryoneelese.
Is this a cute joke or is he being serious and oblivious?
Thanks for the warning
Those of you who red and liked clean code (I did too), what's your next best recommendation as a book? The pragmatic programmer?
Isn't that the guy who caused the whole Factorio Kovarex controversy?
What kovarex controversy? Link? Context?
Don't ask his opinions about the term "statutory rape"!
Had to dig around a little, but I think I got some context :
I don't recall Uncle Bob being sexist or racist, but maybe I missed something.
Yes. I never looked at kovarex the same since.
He must have been waiting for me to buy a copy.
Now . After they're done , they should write one for perl and brainf**k
Truly one of the latter day saints
i guess this time the book involves a foreword in every chapter written by a woman that explains why they shouldn't be allowed behind a computer
Dare I ask?
I don't have any examples personally, but I've been told by a lot of people that he has some views about women, race, sex, homosexuality, etc which many would find objectionable.
Edit: his Twitter is pretty much 50% programming, 50% GOP politics. He might be a bit more progressive than your average Republican, but he still expresses a strong anti-left/anti-"woke" set of beliefs.
twitter happened, I guess
But today I stumbled across a long twitter thread that I can only describe as intentional character assassination. The author of this thread is misrepresenting facts and making some pretty nasty accusations. Again this is not all that unusual, except for the fact that I was not invited to defend myself. [...] The gist of this author’s thread is that I am a misogynist; and that I should not be taken seriously in any regard. I understand that efforts have been made to have me excluded from conferences, and to boycott the publisher of my books, etc.
Uncle Bob in 2017
"A woman wrote that joke"