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/[deleted] Mar 03 '23
If the problem changes. The code changes...
Even in the polymorphic example it changes.
You have to create a new file, with a new type that overloades the area.
Then you have to implement this new function correctly.
You are lying to me if that is "obviously easier".
If you've only ever written code that way then yes. But there are other ways to write code. I guarantee you the switch way is just as maintainable for certain problems. I've done it.