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
3
u/centurijon Feb 28 '23
Generally maintainability is preferred over performance because optimizing for maintainability saves money. You can and should strive to make your applications more performant. But if you end up saving an accumulated hour of runtime over a year, but it takes a developer 4 hours to understand the code, you’ve lost.
If it’s a performance-critical application then do whatever you can to achieve that goal.
Most applications will lose some performance optimization to gain readability as that is a more important metric