Aaron Andersen

Recent Blog Posts

argument evaluation order

July 23rd, 2011 | Tags:

tl;dr: order of evaluation of function arguments is undefined in C++; this can cause bugs if you write code that expects it to always be left-to-right.

C++ guarantees that certain things will always happen in a certain order. Common examples are the logical operators, which always evaluate left to right. This enables us to write things like

if(lunch->hasDessert() && lunch->getDessert()->type() == CAKE) ...

to test the result of a function call on a possibly null pointer. This is called “short circuiting” and is universally understood by all but the least experienced software developers.

What isn’t as commonly understood is that sometimes evaluation order isn’t guaranteed, even when you might expect it to be. Read more…

Active Projects


GraphShop is the Graph Theory Workshop, an interactive software environment for Graph Theory research and applications. It contains a visual "point and click" interface for graph creation and manipulations, as well as an integrated scripting environment (using ECMAScript) linked both ways with the GUI systems. This means that one can create a graph with scripting, examine and modify it with the visual interface, and then run a custom script algorithm on the result. More information...

CPD Library for PHP

The Common PHP Development Library is a collection of PHP functions designed to simplify common, repetitive, and boring aspects of PHP development in a way that improves code security, readability, and maintainability.

Unlike more heavyweight frameworks, the CPD Library uses a functional "micromodule" approach: e ach CPD Library function returns a PHP native value or resource, never a custom object; thus, using the CPD Library in one place doesn't obligate you to use it anywhere else. CPD Library functions do not require any specific structure or development methodology, making them suitable for use in existing projects without any code refactoring or steep learning curves.

Source code and full documentation available at https://github.com/stringoftheseus/cpdlib/.