4 ms·
I've seen horrible inheritance/convoluted refactors done in pursuit of DRY. I'm a bigger fan of WET(Write Everything Twice). Usually the first iteration of a c
by vvanders 8y ago
I've seen horrible inheritance/convoluted refactors done in pursuit of DRY.
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.
- icebraining 8y agoWhich is the first iteration, the code or the comment?
- majikandy 8y agoCommonly referred to as rule of 3. Write it out in full twice, on the 3rd time it must be a real abstraction, therefore refactor.
- josteink 8y ago> I've seen horrible inheritance/convoluted refactors done in pursuit of DRY. Everything in moderation, including moderation itself.