7 ms·
I like axioms that go a bit against the grain, so my favourite is number 3: "Duplication is less costly than premature abstraction".
by kieckerjan 6y ago
I like axioms that go a bit against the grain, so my favourite is number 3: "Duplication is less costly than premature abstraction".
- spockz 6y agoThis ties into gold plating. Sometimes a little foresight makes the road a lot smoother when you predicted it right. It will only be premature when it turns out you choose the wrong path.
- taneq 6y agoGold plating is insurance. It can be insurance against failures or insurance against requirements changes, but either way, you don’t judge its value by whether you use it but by whether it mitigates a risk enough to improve your expected outcome.
- UK-Al05 6y agoThe problem with this very popular assertion is the assumption people abstract to remove duplication. They don't. They abstract to operate on a higher level of thought. I.e Business policy not networking code.
- SPBS 6y agoAbstractions are often formulated even when there is only one call site that currently demands it in anticipation of a future need- don't. Just write the whole thing in a straightforward way and observe which parts chafe whenever you need to make a code change. Then refactor those parts out. Don't be prematurely abstracting into higher concepts before you're sure those are the right concepts to abstract.
- UK-Al05 6y agoRight, so I'll just go ahead and start setting MTU packet sizes, and opening sockets when trying to calculate and send a invoice. Instead write code operating at the level that best expresses the problem you're trying to solve. As if you are writing a business document to explain it. Fill in the concrete details afterwards. If your doing invoices, solve the problem at level of invoices, transactions, percentages, addresses, tax and emails. Best expressed as outside in
- hansvm 6y agoI have definitely been on the code review for abstractions which did nothing other than remove some duplicate lines of code. The author admitted as much and was certain it was still a good idea.