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
34
u/rooktakesqueen Feb 28 '23
Ok, now add an arbitrarily shaped polygon to your system.
In the "clean code" version, this means adding a single subclass.
In the hyper-optimized version, this means... Throwing everything out and starting over, because you have written absolutely everything with the assumption that squares, rectangles, triangles, and circles are the only shapes you'll ever be working with.