News for hackers. Stuff that matters.
Re:Your CPU may have slowed down on Wednesday by elvischidera on Tuesday June 22, 2021 @08:39AM (#27590891)
It could be OP is referring to multiple layers of (unnecessary) abstraction.

In Android land for example, there is a popular "clean" 3 layer architecture, where model classes are blindly mapped multiple times (even in cases where this is suboptimal).

I have lost count of people building "clean" inefficient caching mechanism instead of just using an HTTP cache.

Side note:

I believe these things are useful in some situations. Maybe the solution is to have a smart compiler that compiles out these inefficiencies?

Some (most?) apps are just skins around a database. Amazing what Facebook did with Messenger rewrite [0]

Is there an incentive problem? Generally, people get bonuses/accolades for making a slow system fast, not for keeping a system consistently fast. I admit the former is easier to measure.

0 - https://engineering.fb.com/2020/03/02/data-infrastructure/me...

Re:Your CPU may have slowed down on Wednesday by handrous on Tuesday June 22, 2021 @09:19AM (#27591224)
Maybe it's my bias but I took "clean code" not in the traditional sense, but to mean insisting on patterns perceived to be "pure" or "clean" even when their application harms performance or isn't a great fit for the host language (ahem, JavaScript and functional + immutable-datastructure programming) and makes it even easier for devs to footgun into bad performance while staying "pure".
Re:Your CPU may have slowed down on Wednesday by miltondts on Tuesday June 22, 2021 @09:48AM (#27591565)
Yes, I should have typed "clean code". It's exactly what you and also what the parent said. It's about patterns/architectures/abstractions that we consider to be good/beautiful, but with very little regard for performance ("just throw more or better hardware at it, that is not our problem"). What really rubs the salt on the wound, is that the people that advocate them are quite loud, they seem to be growing in numbers and there is a massive lack of evidence for the supposed benefits, while the drawbacks are clear and easy to measure.
Re:Your CPU may have slowed down on Wednesday by inamiyar on Tuesday June 22, 2021 @09:47AM (#27591559)
I don't think that's what they meant but it's a good point! I've seen embedded developers write some...truly terrifying code though.
Re:Your CPU may have slowed down on Wednesday by 9wzYQbTYsAIc on Tuesday June 22, 2021 @12:34PM (#27593818)
Function purity is a mathematical term with a clear definition and doesn’t deserve the double quotes which imply some vacuous definition or uncertainty.

Assuming you are referring to “pure”, in the context of functional programming and isolation of side effects.

Re:Your CPU may have slowed down on Wednesday by handrous on Tuesday June 22, 2021 @12:42PM (#27593952)
Was what I was referring to actually ambiguous?
Re:Your CPU may have slowed down on Wednesday by 9wzYQbTYsAIc on Tuesday June 22, 2021 @01:44PM (#27594722)
What is ambiguous are the details about how you think that JavaScript and functional + immutable-datastructure programming is detrimental.
Re:Your CPU may have slowed down on Wednesday by handrous on Tuesday June 22, 2021 @01:49PM (#27594779)
Oh, that's totally different from what you posted about before. OK.

Allow me to quote me, to clarify this part, then.

"when [they aren't] a great fit for the host language"

Re:Your CPU may have slowed down on Wednesday by 9wzYQbTYsAIc on Tuesday June 22, 2021 @02:51PM (#27595578)
What remains ambiguous is how it is not a great fit, in that specific case.
Re:Your CPU may have slowed down on Wednesday by heurisko on Tuesday June 22, 2021 @10:01AM (#27591716)
If the OP meant "multiple layers of unnecessary abstraction" I would agree with them.

However "clean code" connotes to me the techniques advocated in "Clean Code" by Robert C. Martin, which amongst other things, advocates small descriptive functions.

Re:Your CPU may have slowed down on Wednesday by shuntress on Tuesday June 22, 2021 @12:10PM (#27593483)
> Maybe the solution is to have a smart compiler that compiles out these inefficiencies?

Compilers are software. A "smarter" compiler is probably going to consume more resources.

Re:Your CPU may have slowed down on Wednesday by elvischidera on Tuesday June 22, 2021 @01:47PM (#27594758)
True. But at least it happens for each compile per developer which is a far smaller number than for each use per end-user.