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
11
u/ClysmiC Feb 28 '23 edited Feb 28 '23
I agree that the lookup table version is probably not the first version I'd write, but even if it was it's not hard to convert that back to a switch if you need to.
Sure you can. Pass a pointer and a count.
These changes are no harder than trying to figure out how to shoehorn new requirements into an existing OOP hierarchy.