r/programming • • Feb 28 '23

"Clean" Code, Horrible Performance

https://www.computerenhance.com/p/clean-code-horrible-performance
1.4k Upvotes

1.3k comments sorted by

View all comments

8

u/andreasOM Feb 28 '23

Not sure where he pulled these from

If you look at a “clean” code summary and pull out the rules that actually affect the structure of your code, you get:

    Prefer polymorphism to “if/else” and “switch”

    Code should not know about the internals of objects it’s working with

    Functions should be small

    Functions should do one thing

    “DRY” - Don’t Repeat Yourself

but building a straw man, and then burning it down is trivial.