Post

Hey Carl and Richard @dotnetrocks.bsky.social, regarding your discussion with Steve Smith about how DRY can sometimes backfire, I think a better guideline is “maintain a single source of truth”. It’s often okay to repeat code, but it’s not so okay to repeat things that should be consistent.

One example is business logic. If you have multiple copies of logic that determines whether a user is authorized to see a particular piece of data, then requirements change, multiple copies must be located and edited to ensure correct behavior of the system, an error prone process.

0 reposts0 likes

No replies yet.