Constructor Failures
Sometimes we fail to acquire a needed resource or responsibility during the construction of an object. Sometimes the construction of a subobject fails. How can we deal with an incompletely […]
Sometimes we fail to acquire a needed resource or responsibility during the construction of an object. Sometimes the construction of a subobject fails. How can we deal with an incompletely […]
Have you seen classes with a method isValid() or something similar? You most definitely have seen and even used such classes. Maybe you have even written such a method yourself. […]
Some of the most surprising bugs I have come across happened when someone (often enough myself) accessed an object outside of its lifetime. There are some pitfalls, common misunderstandings and […]
I have written about handling exceptions some time ago, and about the levels of exception safety last week. What I have not touched yet are exception specifications. I will catch […]
Exceptions are part of C++. They are thrown by the standard library classes, and sometimes even if we are not really using the standard library. So, unless we are in a very restrictive […]
Probably everybody who has written C++03 code had the pleasure of using NULL and stumbling over one pitfall or another. C++11 brought the solution to those issues with nullptr.
Today I write about override and final, a pair of less often discussed, less complicated features introduced in C++11. Both can provide some additional security and clarity when it comes to […]
When it comes to factory functions there is often dispute on which kind of smart pointers to return. As it turns out, the choice depends on the circumstances, so here’s a list of pros and cons.
A programmer who has not mentally resigned already, is constantly learning. This includes taking lessons, listening to talks, reading books and of course blogs and other resources on the web. However, don’t take everything you read or hear at face value.
Since my blog touches clean code topics a lot, I often mention maintainability. In turn, readability plays a major part in maintainability, since what we can’t read properly, we can’t analyze, debug, fix, refactor and extend properly either. But who defines what is readable and what is not?