this post was submitted on 30 Oct 2024
538 points (99.6% liked)

Programmer Humor

32472 readers
467 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 39 points 2 weeks ago (7 children)

C) Write a highly specific, custom-tailored boilerplate generator that does 80% of the work and needs only a day or two to implement.

[–] [email protected] 11 points 2 weeks ago (5 children)

This sounds just extremely dumb to me, as in "do something manually for 2 minutes or spend 2 days automating it"

Also, DRY in 90% of the cases is a sham

[–] [email protected] 3 points 2 weeks ago* (last edited 2 weeks ago) (2 children)

DRY is usually helpful if you don't use it in situations where you have like 2 semi-different things. If they're actually the same and you have 3 or more then the level of abstraction is worth it almost always.

[–] [email protected] 6 points 2 weeks ago (1 children)

To me, there are two classifications of DRY - one I find harmful, the other very useful.

First one resembles mathematical extractions, essentially you never allow a single chunk of code to be written twice and you create massive amounts of global util junk. This also creates some bad tight coupling.

The other is more logical, where you only extract logic in places you want to always change together. Simple and effective.

[–] [email protected] 2 points 2 weeks ago

Yes! Well said.

load more comments (2 replies)
load more comments (3 replies)