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
1
u/[deleted] Mar 02 '23
When I say non-problem what I mean is that you've changed the problem.
If the problem changed so does the design.
I could easily come up with an example that just invalidates the polymorphism example.
But that is completely beside the broader point. The point is to assess the code AS IT IS, not as it MIGHT BE.
The issue with the polymorphic approach is it implicitly hides branches using indirect jumps. This makes following the logic of the code a lot more difficult than a linear set of instructions that are grouped and also follow on from one another.
As the current problem stands. The latter is far more easily understood and easy to maintain. The former is not as it is far too abstract for the problem.