3 ms·
The Exceptional Beauty of Doom 3's Source Code (2013)
- zaroth 10y agoA few times the author expresses a rule as, "you should always do ____, unless you can't," which I really like. Follow the rule just far enough, but never further. When you find yourself thinking, "yeah, I just can't bring myself to do that here..." trust yourself and code on!
- shmageggy 10y agoMy two takeaways from this article are that beauty is in the eye of the beholder, and that C++ is a horrible mess. Many of these examples I found less than beautiful, but hey, to each his own. And I feel bad for the author and anyone else who has to work in C++, since it forces you to choose between genericity and readibility. Either your code is rigid, or it's a bloated, unreadable mess. Here's some "eyebleach" for anyone else who might be a little sad after reading this; I've been learning Haskell and recently came across a definition of a Fibonacci function that I found eminently beautiful. fibs = 0 : 1 : zipWith (+) fibs (tail fibs)
- CyberDildonics 10y agoIgnoring for a moment that Haskell doesn't accomplish the same goals as C++, getting caught up in expressions is something I've found to be indicative of amateur programming. The overall architecture of a piece of software is hugely more important to productivity, speed, and correctness.
- kungtotte 10y agoAmen. You know how often I have to write a Fibonacci function for real? Let alone care about its elegance...
- Todd 10y agoI love that John Carmack took the time to comment on the article, providing some background.