3 ms·
The 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
by UK-Al05 6y ago
The 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.