Hacker News new | ask | show | jobs
by jedbrooke 19 days ago
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.
5 comments

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.

I like HUMID "Hold off Until Many Instances of Duplication"
MOIST: "Mull Over Instances, Seek Third"

Two is a coincidence, three is a pattern.

Related: attributed to Ian Fleming:

"Once is happenstance, twice is coincidence, three times is enemy action."

DAMP: Do As Mf Please
SWAMPY

Software will always metastasise. Probably yeet!

MUD: Maybe... Uh, Dunno
I believe that's also called the Rule of Three.

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

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.
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.