It was another project at another place, and when Paul had settled in, he was given his first task. It was to get an application running after the original author had left. Apparently, it was "giving problems" when someone tried to get the code from the repository and build it. Paul dived into the code and started looking.

The code base was large. Very large. It was an imaging processing test application that gathered images from custom hardware and performed some fairly complex maths. What stood out though, was the idiosyncratic coding. Outside the number crunching, there was a slowly emerging pattern. Every function call took the following form.

int  errors = 0;
do
{
    errors += CompanyProD01_GetProdId(prodId,sizeof(prodId),&prodIdSizeRequired);
    if(errors)
        TRAP_BREAK("");
}

If any call error’d in any way, it threw you straight into the debugger. No message, no warning, no excuses. There were hundreds of these and even system calls were massaged into behaving the same way. Read from a registry key and it’s got a null value? To the debugger you shall go. A file entered into a dialog and not present? Bang into the custom file handler seven derived classes down and two calls short of a macro with no source code available. In release mode, it silently logged the errors until it died. This was difficult but it got worse.

Evidently, the author had heard of DLL Hell and wanted no part of it. Instead, he replaced it with a full, seven-circle, rip roaring, fire and brimstone, Dantesque inferno. It was heavily template based, used its own registry entries and had a versioning system based on macros and a header file. This was all coupled with a license manager left over from a previous project and some custom security code ominously named "cuckoo."

The last straw was the utter contempt the author had for code reuse. Strings? Roll your own. Maths? We can do it better. Memory allocation? Only cowards use 'new' or 'malloc'. Luckily, integers and chars had survived the carnage, but the complete absence of comments matched with an empty set of documentation was the small extra load that shattered Paul's engineering soul.

After many days and nights of this worst-immaginable torment, Paul grimly got it working on the boss's laptop for a demo in less than twenty hours. The boss blinked and then solemnly nodded in appreciation.