Refactoring Session #2a: Matrix Calculation – Code Smells
A while ago, Twitter user @vaughncato sent me the piece of code for this refactoring session. Since there is a lot of things to do on this code, I split […]
A while ago, Twitter user @vaughncato sent me the piece of code for this refactoring session. Since there is a lot of things to do on this code, I split […]
Any C++ developer knows how to compile and link multiple compilation units together. The difficult part can be to determine which parts of the code should be separated in different compilation […]
In the last two weeks I have written about the basics of compile time constants and calculation with those constants. This week I conclude this mini series with the keyword […]
I have written about what we need compile time constants for last week. This time I will dig a bit into where we can get compile time constants from, and […]
Compile time constants are an important part of C++. They contribute to program correctness and allow the optimizer to do a better job. Today I will deal with what is possible […]
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 […]
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.