Top
Best
New

Posted by rafaepta 12 hours ago

Prefer duplication over the wrong abstraction (2016)(sandimetz.com)
446 points | 302 commentspage 8
gaigalas 3 hours ago|
I like the mantra: "prefer duplication over the wrong abstraction".

Combined with another interesting idea "whatever I dislike is wrong", it makes me _always be right_, which is awesome. I can never lose a discussion about abstraction with this powerful combo.

nullbio 10 hours ago||
Code duplication is terrible in the age of LLMs, unless you want to maximize on drift.
hyperpallium2 7 hours ago||
prefer semantic abstraction even when it creates duplication
ilvez 11 hours ago||
Just three words: rule of three.
jongjong 7 hours ago||
Also, I prefer having all the code inside a single 5000-lines file than split up into many small files representing incorrect abstractions.

The urge to split the code up since they beginning is generally a bad idea; it forces early abstraction; more likely to be wrong.

threethirtytwo 8 hours ago||
Duplication and the wrong abstraction are looking more and more to be implimentation details handled by AI. A possible future may be a place where none of this matters.
lazide 9 hours ago||
Yes, but counterpoint - code duplication is also the wrong abstraction.

Pro tip - which is the least bad abstraction? Answer: it depends!

vcryan 10 hours ago||
The sweet spot is really duplicating the wrong abstraction: I see you Claude!
johnwheeler 10 hours ago|
These are not mutually exclusive.
More comments...