this post was submitted on 10 Aug 2024
587 points (97.3% liked)
Programmer Humor
19488 readers
1038 users here now
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Sorry, I still don't really get the hate.
I use what I learned from watching a talk by him on clean code and I had to learn some stuff. It might be "common sense" for experienced developers. But it certainly doesn't come naturally that "functions should do one thing" to first time coders. The thought processes of when the software was developed usually isn't the best way the code should be structured in the end. But that's usually how beginners code.
In most diciplines, experience in the field is what makes the knowledge of the field. You don't always have to be able to explain why good practice does what it does.
Also: I know of some examples, where he clearly explains his reasoning, e.g. why comments shouldn't explain how the code works. (Because they're not going to be updated, when the code will be)
Either you misrepresent him, or you get a hard nope from me. Staying on one layer of abstraction is most likely my most important principle of writing understandable and maintainable code.
Which of these do you prefer?
A?
Or B?
Uncle Bob's Clean Code suggests
Option AWhy in the holy mother of rust is A the better option?
His idea is that it’s faster to read that short string once you learn how to read it. But then you need to learn how to read it.
In my experience, every time I thought of something clever like this, I’ll almost always regret it a month later when I revisit the code.