News for hackers. Stuff that matters.
Re:I don’t buy “duplication is cheaper than the wrong abstra... by overgard on Tuesday August 29, 2023 @02:54PM (#37312216)
I'm not sure that's true, when I look at the code bases of some of the most productive coders I can think of (John Carmack and the Doom and Quake code bases for example), they tend to be fairly conservative with how much they abstract things. There's a lot of very thoughtful data structure usage (git is another good example of this) and diligence in maintaining a coding standard (which generally has little to do with formatting), but most of the code seems to be more concrete and task focused rather than abstract.

I think Casey Muratori has a good way of thinking about this, with his concept of "semantic compression" ( https://caseymuratori.com/blog_0015 ). To me that's a lot more valuable than the ideas that you get in say something like Clean Code (which in my opinion, the popularity of that book has been a disaster for the industry)

Re:I don’t buy “duplication is cheaper than the wrong abstra... by coliveira on Tuesday August 29, 2023 @03:11PM (#37312435)
There are useful abstractions and useless abstractions. A lot of the GoF designs are bad abstractions (if used indiscriminately) and clutches for bad languages. However, using problem-focused abstractions is a big time saving strategy.
Re:I don’t buy “duplication is cheaper than the wrong abstra... by wvenable on Tuesday August 29, 2023 @03:01PM (#37312308)
I'm positive they don't have much in the way of duplicated code.

Abstraction can be as simple as a function.

It seems odd to give really good examples of abstraction and then sort of do a No true Scotsman argument on it. "It can't be abstraction because it's not terrible."

Re:I don’t buy “duplication is cheaper than the wrong abstra... by Kapura on Tuesday August 29, 2023 @03:11PM (#37312427)
so your argument is, "you've got to write functions, therefore abstraction is always good" ?

yeah man i don't start in main() and never write another function ever again. You got me. But I also don't aggressively police duplication, accepting that I would always rather see what's happening without file-hopping. The correct abstractions will simplify code, and they will seem obvious (even if just in retrospect). Abstractions that force me to continually re-frame the problem i am trying to solve in terms of another's use case are antithetical to writing the sort of code that I do.

Re:I don’t buy “duplication is cheaper than the wrong abstra... by wvenable on Tuesday August 29, 2023 @03:19PM (#37312535)
You don't have to write functions. Have you ever seen a 10,000 line code that was just a single function -- I have. It also had nested if statements 5 levels deep to handle all sorts of logic with lots of duplication. It was unmaintainable. Yet it did meaningful work and it could have been refactored to a fraction of the size and do the same work. But, to be honest, when I had to fix it I just went it and fixed in the 20 places that needed changing because it was impossible to follow.

You like good abstractions and you hate bad abstractions. I couldn't agree with that more.