In many legacy code bases we encounter functions that get their parameters passed by plain pointers. Often those pointers are expected to be not null. In this post I am […]
C++ is a multi-paradigm language, so it is not a purely object oriented language but has other aspects, for example a huge support for generic programming via templates. One of its major […]
In 2012, Martinho Fernandes coined the Rule of Zero in a blog post. In 2014, Scott Meyers wrote a blog post about a concern with that rule and proposed a Rule of Five Defaults. In this post I am going to wrap up my thoughts about the two posts and propose a “Rule of All or Nothing”.
Some people adhere strongly to design patterns. They have read the “Gang of Four” book and are now convinced that there should be a design pattern used in almost every […]
I often see people use handcrafted loops or write weird workarounds for stuff the standard library has already taken care of. This does not only apply for standard library features but also for any other library, like Boost, other third party libraries and the libraries the code belongs to.
It has been just under a month now since I started this blog. I must say, I am overwhelmed by the responses so far. I would have expected the first few […]
I am going to tell you a story about an issue that brought me a rather painful debugging session, and the lessons that can be learned from it. A few […]
Sometimes when I factor out a function, I see a more general algorithm hidden in that function. And then I get carried away generalizing it more and more.
In C++ there are two ways of type conversions: implicit and explicit type conversions. The latter are called type casts and they are what this post is about.
Among C++ developers there often appears to be a misconception about what it means to deal with code that can throw exceptions. The misconception is that the possibility of exceptions […]