PayloadOffset_t: A small type design challenge
Recently, I had to make a relatively small design decision – which type to use for a small range of values. As usual in C++, there were a number of […]
Writing maintainable, easy-to-read code
Recently, I had to make a relatively small design decision – which type to use for a small range of values. As usual in C++, there were a number of […]
There is a difference between guidelines and rules. Boiling down guidelines to one-sentence rules has drawbacks that make your code harder to understand.
When classes have an “isValid” method or similar, the code using them often is less clear and harder to maintain. If possible, validity should be an invariant that can not […]
Today we have another guest post by Alfredo Correa. In his previous article, Functions of variants are covariant, Alfredo described the concept of a covariant function, that is, how a […]
You’ve probably heard about the rule to prefer standard algorithms over raw for loops. The major reason is that those algorithms say what is happening in the name and encapsulate […]
Today, I am happy to announce a guest post by Andrey Karpov about the evil of macros. Andrey is a Microsoft MVP in the “Developer Technologies” category and one of […]
The pImpl idiom is a useful idiom in C++ to reduce compile-time dependencies. Here is a quick overview of what to keep in mind when we implement and use it.
Keep simple data structures simple! There’s no need for artificial pseudo-encapsulation when all you have is a bunch of data.
Sometimes we need unformatted data, simple byte sequences. At first glance, std::string might be a fitting data structure for that, but it is not.
Now and then we have the need to call functionality that was written in C from our C++ programs. For that, we need to use and understand extern “C”.