logoalt Hacker News

jedbrooke • today at 1:10 AM • 5 replies • view on HN

reminds me of WET: Write Everything Twice. Instead of immediately jumping to DRY, actually write out the two similar tools, then see what actually makes sense to combine into a shared dependency.


Replies

caller9 • today at 1:53 AM

I like HUMID "Hold off Until Many Instances of Duplication"

➕ show 1 reply
TwisterK • today at 8:06 AM

my version of this is that, as it is getting closer to user perceived layer, use WET, as it move away from user preceveid layer and toward system level, use DRY.

kijin • today at 4:12 AM

Yes, writing it twice is the perfect way to figure out the right level of abstraction for your project, and how extensible your components need to be. Try to do it with only one instance in front of you, and you end up with all sorts of unnecessary abstractions "just in case".

If you find yourself writing it a third time, on the other hand, you should seriously start consolidating.

ginko • today at 10:08 AM

I believe that's also called the Rule of Three.

https://en.wikipedia.org/wiki/Rule_of_three_(computer_progra...

tejtm • today at 7:14 AM

WET will always be "We enjoy typing!" to me.

Although in reality I wrote some things thrice before deciding to condense them and I considered it decently DRY.