An analysis of why popular Clean Code recommendations can lead to bugs and make code harder to maintain.
In my "Top 10 Software Developer Books" video, there was a lot of discussion about "Clean Code."
It's horrible. It's based on flawed assumptions, and it makes code harder to maintain. In this video I'm going to talk about some specific examples that Clean Code gets wrong, the workflows it prevents, and a bug that took me days to find that Clean Code's STUPID recommendations can cause.
I'll also discuss what "maintainable" really should mean.
There's no way I can cover everything wrong with this book (or everything you need to know to write maintainable code) in one video - so expect more of these.
Most "clean coding" advice is bad
"Clean Code" is trash
Thing like "Clean Code" only serve to create arguments
"Maintainable" is judged by people other than the programmer writing it
"Maintainable" code is useful when you do something else for a while and then come back
Code is not read top to bottom like a book
Real programmers read code from the bottom up
"Clean" codebases tend to obfuscate bottom-up reading
Vertical slices of code
Root of much programming advice
Welcome to Whack-A-Mole
Specific Example - Real Bug (details changed, yada yada)
The bad assumption in most coding advice: Bugs are preventable
A bug that's hard to reproduce means the code is bad
The real point of maintainable code
Rant
Wrap up
Why it's here
3 people recommend this
What people say. Recommended as a solid critique of Uncle Bob's Clean Code and SOLID principles.
Can you give us some examples?
Nowadays what people call Clean Code is completely random, sometimes directly opposite to what is in the book. Not all ideas of Uncle Bob are good even. His obsession with SOLID is a huge source of spaghetti in our world, because you need to be a design god to be able apply these rules while at the same time following KISS.
[video
Here's Dan's talk about avoiding/delaying abstractions: https://www.deconstructconf.com/2019/dan-abramov-the-wet-codebase
Here's a short video explaining this (8:00+): [video
Primeagen (3:40+): [video
Grugbrain on Primeagen show (long video, they trash abstractions a lot here) [video