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 […]
The post isValid()? Establish invariants and avoid zombie objects appeared first on Simplify C++!.
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 […]
The post Multiple dispatch over covariant functions appeared first on Simplify C++!.
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 […]
The post algorithms and the KISS principle appeared first on Simplify C++!.
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 post Macro Evil in C++ Code appeared first on Simplify C++!.
Keep simple data structures simple! There’s no need for artificial pseudo-encapsulation when all you have is a bunch of data. Recently I have come across a class that looked similar […]
The post Simple data structures appeared first on Simplify C++!.
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". The […]
The post Calling C Code from C++ With ‘extern “C”‘ appeared first on Simplify C++!.
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. A […]
The post Tailor Standard Containers to Your Needs appeared first on .
_Today we have another guest post by Phillip Johnston about error logging. Phillip is an embedded systems consultant specializing in bare-metal firmware development in C and C++. Embedded Artistry is […]
The post The Dark Side of Error Logging appeared first on .
After having had to clean up some unusual #include techniques, I’ll put together some advice on how not to use #include – and how to use it. Last week I […]
The post #include – Don’t get fancy appeared first on .
Today, Matt Bentley writes for us about terse names in our Code. Matt was born in 1978 and never recovered from the ordeal. He has lived a long and interesting […]
The post Terseness: how little is too much? appeared first on .
In many projects, there is a certain amount of code generation. The generated code is not seldom treated as a second-class citizen, the only measurement of code quality being whether […]
The post Clean Code Generation appeared first on .
Doing code reviews means interacting with other humans, which we need to take into account. We also often have the luxury of being able to choose the reviewer, and the […]
The post Code Reviews – The Human Aspect (Part 5) appeared first on .
We finally come to the core post of this series – how to do code reviews. This post is part of a series of posts about code reviews: Code Reviews […]
The post Code Reviews – How? (Part 4) appeared first on .
The “how” part of this post about code reviews got rather long, so I had to split it into two parts. This part is about preparing our code and our […]
The post Code Reviews – Preparation (Part 3) appeared first on .
Now that we know good reasons to do code reviews, which parts of our code need to be reviewed? What does not need review? This post is part of a […]
The post Code Reviews – What? (Part 2) appeared first on .
The mutable keyword seems to be one of the less known corners of C++. Yet it can be very useful, or even unavoidable if you want to write const-correct code […]
The post Mutable appeared first on .
Code smells are indicators that there might be something afoul in our code. Here is a list of some of the most important smells. What are code smells? A code […]
The post Code Smells – a Short List appeared first on .