How to refurbish legacy code into a maintainable state

So you (or rather I) have this legacy code that must be maintained. It has all the classic symptoms: it looks like it was written before const, smart pointers or RAII were a thing the author was a big fan of (overly) defensive programming either not much thought went into the overall design or over Read more about How to refurbish legacy code into a maintainable state[…]

Enhance type safely using Opaque Typedefs aka phantom types

Its seems every year (see references at the bottom) someone writes about having strong typedefs in C++. Hey, it’s end of February and nobody did it for 2018 yet!? The idea is simple (or so it seems). Suppose you would like to distinguish variables that have the same basic type and have the compiler enforce Read more about Enhance type safely using Opaque Typedefs aka phantom types[…]

Win32 library on Windows 10 Creators edition using Outputdebugstring

At a readers request, I wrote this post describing a ‘Windows 10 Creators Update’ quirk/feature. the symptom: While testing Debugview++ on Windows Windows 10 1703 Creators Update Build 15063.413 (the latest version at the time) one of my users found that the application hangs at startup for about 20 seconds, before actually continuing the startup. Read more about Win32 library on Windows 10 Creators edition using Outputdebugstring[…]

Personal preferences for the use of pointers and references

A blog post about pointers and references? What kind of newbie am I? Well, the kind with 20+ years of programming experience that is not afraid to admit his ignorance, apparently? on the other hand; maybe its not that easy? maybe I didn’t paying that much attention when it was explained to me? maybe things Read more about Personal preferences for the use of pointers and references[…]

C++, where initializing variables is the topic of debate, by experts.

Let me first say: I did not come up with the title myself, but have to credit it to cpplang @ slack.com. Unfortunately I forgot who actually said it. So what is so interesting about initializing a variable you might ask? Lets take a simple struct: struct Foo { int x; int y; }; And Read more about C++, where initializing variables is the topic of debate, by experts.[…]

Introducing mt_shared_ptr<>, a shared pointer for multi-threaded use

Disclaimer: this is a work-in-progress, is bound to contain some mistakes and the code was only briefly tested. Use at you own discretion. In a previous blog post called ‘std::shared_ptr<> broken?‘ I talked about the problems of using a std::shared_ptr<> from more then one thread at the same time. There I mentioned the reading/writing to Read more about Introducing mt_shared_ptr<>, a shared pointer for multi-threaded use[…]