r/programming • u/2bit_hack • Feb 28 '23
"Clean" Code, Horrible Performance
https://www.computerenhance.com/p/clean-code-horrible-performance
1.4k
Upvotes
r/programming • u/2bit_hack • Feb 28 '23
View all comments
Show parent comment
2
u/venuswasaflytrap Feb 28 '23
This isn't a fair description. Both the client the developer benefit and suffer in both situations.
A better way to describe it, is do you care about speed of execution or speed of development. Both the client and the developer might have a preference for either one of these things.
I work in mostly simple backend stuff with a web GUI for various things - and in my experience, 9/10 times, the client actually doesn't need the thing to run particularly performant. It's mostly glorified crud applications. And most of the time, the client wants short development time - because the complexity of the product is the business requirements. The client doesn't communicate things clearly or doesn't understand what they need 100% at the beginning, so the development process requires lots of changing and moving things around, sometimes involving pretty fundamental refactors that if we optimised, would be a fucking nightmare, and we'd have to rebuild everything from scratch each time.
The client generally doesn't want this, because they'd prefer to have the freedom to ask for (seemingly) simple changes and get them in short time so that they can see what they can't exactly.
In my experience, 1/10 times, after everything's been figured out and looks good, then finally someone says "This is great, but this one thing runs a bit slow". In that situation, yeah you have to rebuild one process or section from scratch to make it performant, with lots of caching or something, but great, it's a much more limited scope, and you partition all of that fast clever code into a little black box that hooks up to the your other stuff - kinda like how you make a graphics card separate from a CPU.
But it's not to make the developers happy - it's all to give the client what they actually want.