« I Am Happy | Main | Look At My Ugly Code »

July 30, 2009



I recently dug into the FCollada code to import some collada files into the engine i was testing. I was quite surprised by how nice it was. As you said in comparison to how much bad code i've seen. Given the lack of any agreement on a standard set of 3d classes in my experience. This might be a decent choice.


I can't think of any particular open source project that qualifies, but I can tell you criteria that are necessary (but not sufficient).

It needs to be well formatted, and consistently so, so that I can follow the program flow without having to read every symbol.

It needs to be commented correctly. By that, I mean header comments for each function that document the API, and any side effects, and basically no comments inside functions, that prevent you from being able to follow the program flow. If some piece of code is tricky enough that it needs commenting, there better be a pretty darn good reason to not just rewrite the code to be clearer. Also, comments should actually match the code.

Functions should be short enough that you're no more than a couple of page-ups to where any local variable it uses is declared.

Basically what I'm saying is that beautiful code is code that goes out of its way to facilitate me following it when I'm not familiar with the contents, either because I didn't write it, or because I wrote it so long ago I don't remember it.

Joel Martinez

I know it's not gamedev related, but the ASP.NET MVC source code can be seen online here:

for webdevs, it is beautiful code


This public domain indie game library called "Pixie": http://www.tophatarcade.com/dev/pixie/

I was pleased whenever I opened the source to look at anything. I don't agree with the code formatting, but the code itself is easy to read and understand - and more importantly - to extend.


I must admit I ussualy take advantage of open-source software without even checking the source files; but every now and then I have to check some files for errors (errors ussualy coming from my side) and honestly, I either feel like I'm coding something terribly wrong, either they're coding something terribly wrong. The sad part is that they ussualy don't, I am.

Still, I can remember a great open source project that made me think that's a beautifull code, and the best part is that it's a game.

I'm talking about "Hero of Allacrost". Not sure if I can add links here but you can Google it :) That's beautifull code really.


The comments to this entry are closed.

Jamie's Bragging Rights

  • Spider-Man 2
    The best superhero games of all time Game Informer
    Top five games of all time Yahtzee Croshaw
    Top five superhero games of all time MSNBC
    Top 100 PS2 games of all time Official Playstation 2 Magazine
    1001 Games You Must Play Before You Die Nomination for Excellence in Gameplay Engineering Academy of Interactive Arts & Sciences
  • Schizoid
    Penny Arcade PAX 10 Award
    Nominated for XBLA Best Original Game
    Nominated for XBLA Best Co-Op Game