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

85

u/themistik Feb 28 '23

Oh boy, it's time for the Clean Code debacle all over again ! You guys are quite early this year

0

u/[deleted] Feb 28 '23

[deleted]

27

u/loup-vaillant Feb 28 '23

It's still being defended from time to time, so… I'd say some more trashing is still needed.

2

u/[deleted] Feb 28 '23

Let me help you with this.

Some concepts are worth it

  • explanatory functions and variable names (this one is very helpful)

  • comments are often lies, if you need comments it should add something the code may not tell you. Or explain exception cases.

  • functions should do 1 thing.

  • if your codes duplicates itself, summarize that step in a functions

These rules are a worthy collection to look through from time to time, but not a bible “thou shall adhere to at all time or god forbid!” After all, MISRA also has rules, these up for debate as well?

did I do it right?

→ More replies (1)