Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Qchmqs5378ydry isn't a "principle" it's common sense in programming, always aim for a reasonably general solution before making the same functionality twice, if a general solution is an overkill, extract the similarities in a shared common core, there a fuckton of ways to do this without repeating yourself or over engineering
-
Qchmqs5378y@itsfhm that's like saying eating with forks is bad, because my grandma makes a mess when she uses one
-
kunashe19868y@Qchmqs I like the analogy. Though I think there are valid cases where DRY creates more complexity and risk.
For example, say we were designing an aircraft - two engines or one? A single engine design needs more than twice the engineering effort and can fail in more ways than a smaller engine of half the power.
I agree that duplication without refactoring is bad. But if like DNA you duplicate and refactor. You can achieve an efficient design more quickly than if you set about with a complex first version of a design. -
Qchmqs5378y@kunashe dry isn't for physical objects, in your example, do we make a new machine to build each engine ? do we design each engine from scratch ?
I feel that sometimes using the principles of DRY is just overkill and serves as an incubator for over engineering something that could be really simple. Something's are just going to be used once and never again...
This is not a anti structure rant just a thought.
undefined