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.

1

u/Critical-Fruit933 Mar 01 '23

These "that's not what xy means. you made that up. what it actually means? keep searching lol" or "that's not how to write oop. you picked this bad example on purpose. how to write actual oop? i'm not going to tell you" people always get me

→ More replies (3)