97
Don't DRY Your Code Prematurely (testing.googleblog.com)
submitted 1 year ago* (last edited 1 year ago) by hono4kami@piefed.social to c/programming@programming.dev

DRY = Don't repeat yourself

you are viewing a single comment's thread
view the rest of the comments
[-] jonc211@programming.dev 60 points 1 year ago

I’ve always understood DRY to be about not duplicating concepts rather than not duplicating code.

In the example here, you have separate concepts that happen to use very similar code right now. It’s not repeating yourself as the concepts are not the same. The real key is understanding that, which to be fair, is mentioned in the article.

IMO, this is where techniques like Domain-Driven Design really shine as they put the business concepts at the forefront of things.

[-] sip@programming.dev 0 points 1 year ago

I guess I never thought of it like this, but it resonates.

load more comments (8 replies)
this post was submitted on 20 Dec 2024
97 points (92.2% liked)

Programming

25521 readers
385 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