Re:Please do not attempt to simplify this code
by majikandy on Friday December 28, 2018 @03:04AM
(#18775435)
Commonly referred to as rule of 3. Write it out in full twice, on the 3rd time it must be a real abstraction, therefore refactor.
Re:Please do not attempt to simplify this code
by josteink on Friday December 28, 2018 @06:15AM
(#18776149)
> I've seen horrible inheritance/convoluted refactors done in pursuit of DRY.
Everything in moderation, including moderation itself.
Re:Please do not attempt to simplify this code
by icebraining on Thursday December 27, 2018 @06:26PM
(#18773582)
Which is the first iteration, the code or the comment?
I'm a bigger fan of WET(Write Everything Twice). Usually the first iteration of a component you don't understand enough of the domain space to get the abstractions right. So use that first attempt to explore the issues/problems/corner cases. Once well understood, rewrite it into something concise and well abstracted.
I've also find that if you try to re-write a third time you'll end up being to clever in trying to predict where a system will evolve and get you right back into the same situation as the first iteration.