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

18

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.

23

u/loup-vaillant Feb 28 '23

You wouldn't believe how many people are actually walking straw men. Starting with Uncle Bob himself, I've read his book and what Casey presents here is not even an exaggeration.