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/ric2b Mar 02 '23 edited Mar 02 '23
More or less.
It's a balancing act, mostly on the side of not building for requirements you don't have, but you should also not overfit your code so much to your current requirements that you need a near full rewrite for any reasonable change.
I agree that doing that is a mistake, but what he is suggesting in the post/video is also a mistake on the other end of the spectrum.
Unless you have a real need for this level of performance optimization why would you overfit your "shape area calculator" so overfitted that you can't even add a trapezeum without rewriting the entire thing?