isValid()? Establish invariants and avoid zombie objects
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 […]
Writing maintainable, easy-to-read code
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”.
Today I am happy to present a guest post by Alfredo Correa about covariant visitors for std::variant. Alfredo works at Lawrence Livermore National Laboratory where he uses C++ to develop […]
We often use standard containers as members of our classes. In a lot of cases, the semantics we actually need is not equivalent to the semantics the containers provide.