this post was submitted on 09 Oct 2025
47 points (100.0% liked)
Programming
23053 readers
117 users here now
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Rules
- Follow the programming.dev instance rules
- Keep content related to programming in some way
- If you're posting long videos try to add in some form of tldr for those who don't want to watch videos
Wormhole
Follow the wormhole through a path of communities !webdev@programming.dev
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Not clean code - uncle Bob is a hack.
KISS YAGNI DRY in that order.
Think about coupling and cohesion. Don't tie things together by making them share code that coincidentally is similar but isn't made for the same purpose.
Don't abstract things until you have at least 2 (preferably 3) examples of what you're trying to abstract. If you try to guess at the requirements of the 2nd or 3rd thing you'll probably be wrong and have to undo or live with mistakes.
When you so abstract and break things down, optimize for reading. This includes maximizing loading the code into your head. Things that make that hard are unnecessary indirections (like uncle Bob tells you to do) and shared state (like uncle Bob tells you to do).
Pure functions (meaning they take inputs and remit outputs without any side effects such as setting shared state) are the platonic ideal. Anything written not as a pure function should have a reason (there are tons of valid reasons, but it's a good mental anchor)
I should really read the Ousterhout book. It would be great if I could just point people at something, and it sounded decent from that discussion between him and Bob I saw the other day
Edit: I don't agree with everything in here but it's pretty great https://grugbrain.dev/
Your principles and order are good; before DRY I'd insert "a little copying is better than a little dependency." (Rob Pike)
I'm a fan of KISS YAGNI DRY, in that order, or as I've started calling it KYDITO, thus triggering the next generation of acronyming.