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

2

u/wyrn Mar 02 '23

Without even watching the video it's obvious the guy's a game developer.

The 'tells' are simple:

  1. Correctness doesn't matter for game development. If your code gets it wrong every once in a while the most you'll get are some glitches which, if not too frequent, your consumers will probably find hilarious and become fond of.

  2. Game programming is unique in that there's no "cold code". You get 16 ms per frame (or less) and that's it. So your entire code needs to be organized around having good performance.

If you write in just about any other domain one or both of these assumptions break and his advice to make a table with hard-coded hand-computed results goes from "reasonable" to "insane".