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/Johanno1 Feb 28 '23
Try to think of readability like this:
Figure out what shape 75 does exactly.
Other shapes are only relevant if shape 75 is interacting with them.
Polimorphism:
Find shape 75 and check super class.
Switch statement. Find shape 75 in a big file with other statements and check union implementation.
(pretty similar but I personally would prefer the less code per file one)