“Clean Code, Horrible Performance” Discussion
At some point in my programmer career I figured out that optimizing for human comprehension, a.k.a. &quot;clean code&quot;, is a valid goal.<p>I watched Casey&#x27;s video in full and agree with all the points he made. But as others pointed out, he focus on squeezing every bit of performance in the context of real-time video game logic, and this isn&#x27;t representative of every programming problem.<p>As an addendum to Casey&#x27;s video, another popular technique for squeezing more performance is to invert the normal array-of-structs to a struct of arrays, as it tremendously improves SIMD&#x2F;vectorization. <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;AoS_and_SoA" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;AoS_and_SoA</a><p>For a lot of things that I work on, simply having correct, complete, working code is most of the battle. Execution performance takes a backseat to development time, data acquisition time, human analysis of the problem space and generated output, etc. So by default, I follow Knuth&#x27;s advice that premature optimization is the root of all evil. I write clean code but go into Casey mode when the numbers justify it.