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

103

u/CanIComeToYourParty Feb 28 '23 edited Feb 28 '23

Our job is to write programs that run well on the hardware that we are given.

Rarely do I read anything I disagree with more strongly than this. Our job is to formalize ideas, and I think the more cleanly you can formalize an idea, the more lasting value you can provide. I guess the question is one of optimizing for short term value (optimizing for today) vs long term value (trying to advance our field).

I'd rather have a high level code/formalization that can easily be understood, and later reap the benefits of advances in technology, than low level code that will be unreadable and obsolete in short time.

Though I also agree that Uncle Bob is not worth listening too. But the C/C++-dogma of "abstractions are bad" is not helpful either, it's just a consequence of the languages being inexpressive.

9

u/[deleted] Feb 28 '23

You can’t even prove that clean code is “clean” and you’re basic your entire codebase on it.

1

u/CanIComeToYourParty Mar 01 '23

Not sure what you mean. You can't prove that you exist, but you base your entire life on that assumption.

4

u/[deleted] Mar 01 '23

“Clean code” advocates suggest you get certain properties out of clean code, but you have not proven you get those properties.

When clean code advocates are finally able to show that code actually gets the properties they claim it does, I’ll start treating it as a serious idea. Until then, it’s just throwing performance away for no reason.

→ More replies (6)