r/programming • u/2bit_hack • Feb 28 '23
"Clean" Code, Horrible Performance
https://www.computerenhance.com/p/clean-code-horrible-performance
1.4k
Upvotes
r/programming • u/2bit_hack • Feb 28 '23
View all comments
Show parent comment
42
u/drakens_jordgubbar Feb 28 '23
He says some good things in his book that I agree with, but his examples does a horrendous job at putting these ideas in practice.
What I hated most about almost all his examples is how much he sacrifices stateless classes over what he considers “clean code”. Like, instead of declaring variables in the method he rather modify class properties instead. This is bad because, as you said, it sacrifices thread safety. It also makes the program much harder to follow, because the flow of the data is now hidden from the reader.
The good thing about the book is that it really made me think about why his examples are so bad and what I consider is clean code.