| ▲ | fny 3 hours ago | ||||||||||||||||
Code duplication is cheaper than the wrong abstraction. If you have a good abstraction, you should run with it. If you haven't figured out a good abstraction at 5-100 customers, God help you. | |||||||||||||||||
| ▲ | feoren 2 hours ago | parent | next [-] | ||||||||||||||||
A good abstraction? As in one? I'd go so far as to say the process of discovering and refining abstractions is the most important part of software engineering. A large project has dozens of abstractions, and some of them are "wrong" at any time, as you discover over time. None are ever perfect. If you wait to stop duplicating code until you have the "right" abstraction, you are just putting off the hard part of developing software and taking on tech debt. Half of your abstractions are wrong. The hard part is knowing which half. | |||||||||||||||||
| |||||||||||||||||
| ▲ | stymaar 2 hours ago | parent | prev | next [-] | ||||||||||||||||
> Code duplication is cheaper than the wrong abstraction This is tautological though, it's like saying “starving is much better than eating the wrong food” (for instance: eating quick lime). Of course you'll always find a way to do things wrong in a way that is costlier than not doing anything. | |||||||||||||||||
| |||||||||||||||||
| ▲ | enos_feedler 2 hours ago | parent | prev | next [-] | ||||||||||||||||
What if there is no good abstraction for the entire stack of software on each of computers? What if we built a common one because we had to? What if now we get to all make our own with natural language? | |||||||||||||||||
| ▲ | dofm 3 hours ago | parent | prev | next [-] | ||||||||||||||||
I disagree. But also it's very possible to not realise you needed an abstraction until it catches fire in multiple places. And quite often it's not you that got the codebase to a hundred customers, is it? Sometimes it is a sequence of fresh-faced young developers who didn't have the authority to say "this duplication is bullshit" and were instead compelled to repeat it. I think a lot of these discussions happen in nice little blog-post vacuums of progressive thinking, where people can go "mmm, object oriented coding obscures intent and clarity, mmm", blog posts with "an X is a Y", "the unreasonable effectiveness of foobar" etc. In the real world, every duplication that works sticks for good; there is rarely budget to electively replace code that isn't broken. Until one day it doesn't work. And then… how many times is it actually duplicated? How many of the duplicates diverged? How many of these do we no longer need? | |||||||||||||||||
| |||||||||||||||||
| ▲ | locknitpicker 2 hours ago | parent | prev [-] | ||||||||||||||||
> If you haven't figured out a good abstraction at 5-100 customers, God help you. This blend of opinion is very naive. Every single project is a business requirement away from having the wrong abstraction in place. | |||||||||||||||||
| |||||||||||||||||