Category: C++
How to learn more as a C++ software engineer
A couple of years ago I was looking for new ways to improve myself. I had done several trainings on C++, C#, software processes, communication, leadership, and so on, but I was not really finding what I felt I needed. This is of course very…
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…
Enhance type safety using opaque typedefs, a.k.a. phantom types
It seems every year (see the references at the bottom) someone writes about strong typedefs in C++. Hey, it’s the end of February and nobody has done it for 2018 yet!? The idea is simple (or so it seems). Suppose you would like to distinguish…
Common code smells by Ólafur Waage
This post was triggered by a Twitter thread by Ólafur Waage about the common mistakes he observed during code reviews over a period of four months. Some of these were not news to me, but I had never seen them collected as a set in…
Personal preferences for the use of pointers and references
A blog post about pointers and references? What kind of newbie am I? Well, apparently the kind with 20+ years of programming experience who is not afraid to admit his ignorance. On the other hand: maybe it’s not that easy? maybe I wasn’t paying that…
C++, where initializing variables is a topic of debate among experts
Let me say first: I did not come up with the title myself; credit goes to the cpplang Slack. Unfortunately, I forgot who actually said it. So what is so interesting about initializing a variable, you might ask? Let’s take a simple struct: And create…
Introducing mt_shared_ptr<>, a shared pointer for multi-threaded use
Disclaimer: this is a work in progress, it is bound to contain some mistakes, and the code was only briefly tested. Use at your own discretion. In a previous blog post, ‘std::shared_ptr<> broken?‘, I talked about the problems of using a std::shared_ptr<> from more than…
C++ Weekly
I just watched the first episode of Jason Turner‘s C++ Weekly. Very nice, I could get addicted to that 🙂 I had never considered the complexities a header-only library can introduce (such as having no good place to initialize static variables 🙂
Executors 101
Executors So what are executors? Executors sit between tasks and their execution context, the way iterators sit between collections and algorithms. Executors could potentially do many things, for example: parallelize tasks (over multiple cores, for example) distribute tasks (over multiple machines or to GPUs, for…
x86-to-z80 progress
This is a post on the initial work on the x86-to-z80 translator (or re-assembler, as some prefer to call it). The work is currently suspended pending an investigation into creating an actual Clang back end. The full write-up lives in the project’s README on GitHub.