RAII versus Exceptions
Recently I received a question on Twitter whether to prefer RAII over Exceptions. I have seen similar questions being asked again and again over time, so there seems to be […]
Recently I received a question on Twitter whether to prefer RAII over Exceptions. I have seen similar questions being asked again and again over time, so there seems to be […]
You may be working on a small open source project or on a large corporate team. In either case you will probably have new team members coming in the future. […]
Covariance can be a useful concept, e.g. when implementing the abstract factory design pattern. However, in modern C++, we should return smart pointers that are not recognized to be covariant like […]
In my last post I showed the Visitor design pattern in its fully object oriented implementation. In the post before that I wrote about moving from enums to class hierarchies. I […]
If you have read the “Gang of Four” book about design patterns or just have been long enough in software development, you will have heard of the Visitor pattern. In its fully […]
When an enum controls the behavior of a class, that behavior can sometimes be expressed by class hierarchies.
Sometimes, a fixed set of string values is allowed as input. Often these string values are then stored, used for control flow etc. Enumerators are a better alternative.
I’ll try something new today: I pick a piece of code from the web and see what improvements I would make to it, using small refactoring steps.
In last week’s post I wrote about adding a scripting language to our toolset. I focused on the benefits a scripting language like e.g. Python can bring, especially when it […]
C++ programmers often praise their statically typed language. Having a compilation phase with the possibility to statically check for possible errors is a feature that makes good for the time […]