this post was submitted on 10 Aug 2024
145 points (95.0% liked)

Programming

16971 readers
216 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 [email protected]



founded 1 year ago
MODERATORS
 

Seeing that Uncle Bob is making a new version of Clean Code I decided to try and find this article about the original.

you are viewing a single comment's thread
view the rest of the comments
[โ€“] [email protected] 3 points 1 month ago (1 children)

Usually it doesn't matter what abstractions you choose when you try to factor them to support hypothetical future work, because chances are you incorrectly anticipate future needs.

In other words, generic code that only supports one use case will almost certainly have to be deconstructed to allow a good generic implementation for 2 use cases, so it is better to just write simple code and factor code out when you can see the real commonalities.

In other, other words, KISS, YAGNI

[โ€“] [email protected] 2 points 1 month ago

Good abstractions are important for the code to be readable. An AbstractEventHandlerManager is probably not a good abstraction.

The original commenter said that their code was "generic with lot of interfaces and polymorphism" - it sounds like they chose abstractions which hindered maintainability and readability.