“No matter how slow you are writing clean code, you will always be slower if you make a mess.”

-Bob Martin

“There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.”

-Tony Hoare

Why I’m quitting the C++ Grandmaster Certification course

A few months back I signed up for the C++ grandmaster certification course with the idea that not only would it be educational, it’d be productive and a good resume piece. The Grandmaster Certification course consists of writing a complete, bootstrapped, C++11 compiler (sans optimizer) targeting Linux AMD64 from the ground up, using no 3rd party libraries. This is an interesting feat, as it seems there’s no better way to show that you completely understand a programming language than to write a complete, standards-compliant, bootstrapped compiler for that language. I disagree, and despite how wonderfully ambitious this idea is, I’m quitting

Continue Reading

Optimizing away small classes

Given the great feedback I got on my Degrees and Radians post, and the discussions that followed regarding efficiency of the solution, I thought it would be fun to try and benchmark a few small changes and optimizations.


Continue Reading

Fixing it once and for all: Enforcing units of measure in C++11.

Problem

Game engines are full of stuff like this:

// Defined elsewhere, or in a pre-compiled library.
void rotatef(float angle, float x, float y, float z);
// Another example:
Quaternion fromEuler(float x, float y, float z);

Do these function expect the angle to be in degrees or radians? We’ll look at a few ways you can avoid ambiguities like this from causing subtle, insidious bugs in large projects. Keeping units straight is something that we shouldn’t have to worry about anymore in 2013, but for some reason it’s still a source of very real and very serious bugs in even the most carefully crafted systems.

Continue Reading

Modern software development

An exerpt from Fabien Sanglard’s Doom 3 source code review that really resonated with me.

“Overall the reader gets an immediate understanding of each part of an algorithm and I hope it will inspire people to write better code: Modern software development is not about being an ace programmers anymore. It is about being a team player that empowers co-workers with:

  • Elegant design.
  • Easy to read and commented code implementing it.
  • Doom 3 BFG ranks high on both those metrics.”