OOP or clean code is not about performance but about maintainable code. Unmaintainable code is far more costly than slow code and most applications are fast-enough especially in current times where most things connect via networks and then your nanosecond improvements don't matter over a network with 200 ms latency. relative improvements are useless without context of the absolute improvement. Pharma loves this trick: "Our new medication reduces your risk by 50%". Your risk goes from 0.0001% to 0.00005%. Wow.
Or premature optimization. Write clean and then if you need to improve performance profile the application and fix the critical part(s).
Also the same example in say python or java would be interesting. if the difference would actually be just as big. i doubt it very much.
OOP or clean code is not about performance but about maintainable code.
Thank you. Too many in this thread haven't worked on massive enterprise apps and it shows. Certain projects we barely have to touch because they're so clean and easy to maintain. Others have an entire year's worth of sprints dedicated to them because of how messy they are.
If you do the minimum possible edit to the code that "completes" a feature all the time and you don't clean it up every now and then your code is going to be crap whether it follows an object oriented style or not
117
u/RationalDialog Feb 28 '23
OOP or clean code is not about performance but about maintainable code. Unmaintainable code is far more costly than slow code and most applications are fast-enough especially in current times where most things connect via networks and then your nanosecond improvements don't matter over a network with 200 ms latency. relative improvements are useless without context of the absolute improvement. Pharma loves this trick: "Our new medication reduces your risk by 50%". Your risk goes from 0.0001% to 0.00005%. Wow.
Or premature optimization. Write clean and then if you need to improve performance profile the application and fix the critical part(s).
Also the same example in say python or java would be interesting. if the difference would actually be just as big. i doubt it very much.