News for hackers. Stuff that matters.
Re:Ask HN: What's the most elegant piece of code you've seen? by jamessantiago on Sunday January 31, 2016 @12:25AM (#11005344)
Doom 3 was touted[1] as having some "exceptional beauty." Naming, spacing of properties, consistency, and how multiple parameterized calls were formatted are quite nice. You can see an example on github[2], but for some reason the spacing is a bit off in the web view. I'd recommend cloning a local copy and taking a look.

[1] http://kotaku.com/5975610/the-exceptional-beauty-of-doom-3s-...

[2] https://github.com/id-Software/DOOM-3/blob/master/neo/game/a...

Re:Ask HN: What's the most elegant piece of code you've seen? by Splines on Sunday January 31, 2016 @02:31AM (#11005628)
> but for some reason the spacing is a bit off in the web view.

It looks like Github doesn't explicitly set tab-size so it defaults to 8. 4 seems to work better.

Re:Ask HN: What's the most elegant piece of code you've seen? by zastrowm on Sunday January 31, 2016 @10:21PM (#11009494)
You can set the github tab size via query parameter [1]. The Doom 3 code formats quite nicely then [2].

[1]: http://stackoverflow.com/questions/8833953/how-to-change-tab...

[2]: https://github.com/id-Software/DOOM-3/blob/master/neo/game/a...