Skip navigation

Monthly Archives: April 2014

It was great when it first came out. A competitor to DirectSound that worked on all systems. It still is kind of good.

But, the problem is, it _started out_ free, open, with no licensing fees, and cross platform. People promoted it widely, everyone paid attention, and many adopted it, after all it was “Free! No licensing fee!”

Then Creative Labs took over OpenAL and made it proprietary. But people continued to use OpenAL 1.1… since OpenAL 1.1 “works well enough” it isn’t being updated or maintained, and it continues to see widespread use.

However other sound systems such as FMOD or DirectSound have made many improvements over the base functionality OpenAL 1.1 provides.

The result of OpenAL 1.1 being available is a whole ton of systems is it became very old very fast, it still works, but not nearly as competitively as it did in 2008, for example. And there’s little chance of the situation for OpenAL The Free And Zero Licensing Cost Audio Software of being maintained by the open source community.

I keep coming across code like

for( int deviceIndex=0; deviceIndex < devices.size(); deviceIndex++ )
{
    devices[deviceIndex].something();
    devices[deviceIndex].param += value;
}

what’s wrong with this code? wouldn’t it be a lot better like this?

for( int i=0; i < devices.size(); i++ )
{
    devices[i].something();
    devices[i].param += value;
}

i is a dummy variable. It’s name doesn’t matter – it just needs to be short. devices[deviceIndex] is redundant – we already know what we are accessing by the array’s name, devices[deviceIndex] is just longer and noisier than devices[i] – without adding additional clarity.

Just came across this in a C code apple example:

do
{
  // stuff..
} while (false);

The code breaks the loop when an error occurs inside it. This is kind of like try/catch/finally, where you have a simple catch(…) all block that you jump to if you “break” the loop. It seems like a poor substitute for a function call however.