DEV Community

Discussion on: Stop trying to be so DRY, instead Write Everything Twice (WET)

Collapse
 
thomasjunkos profile image
Thomas Junkツ

My personal take: abstract, when it sucks.

I don't care if code is written once, twice, thrice etc. Sometimes things are a bit boilerplatey / repetitious, which are a good candidate for refactoring. But unless it doesn't suck to write things over and over there is no need to abstract.

A good indicator for suckiness is how error prone things are: if there is potential error prone code in more than one place, debugging really sucks and then you should do yourself and others a favour in centralizing this part.

OTOH to get this right, you need discipline and experience to not confuse it with sloppiness.