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?
Every now and then we have to change something in our build procedure, and more often than not those changes are a real pain. Build scripts are the step children of many software projects. Someone wrote them, nobody cares much about them, they just work and build the project. Until they don’t.
In the last post of my series about (relatively) new C++ features I introduced lambda expressions, which define and create function objects on the fly. I left a few details untouched, […]
Having covered the basics of `auto` and rvalue references, there is a third big new C++ feature definitely worth knowing about: creating function objects on the fly with lambda expressions.
One of the more recent posts in my employer’s company blog is titled ‘What’s wrong with: “I don’t write any tests since I am not a tester”?’ – which made me think about the relation of developers to testing, and about the self-image of any developer who would say that sentence in earnest.
The last weeks I have been writing a lot about move semantics, move operations, rvalue references and forwarding references. While it might take a bit of getting used to all this, there’s good news.
Combining rvalue references with templated function parameters or `auto` behaves quite differently than “normal” rvalue references. Together with the utility function template `std::forward` they allow something called “perfect forwarding” and are therefore also called forwarding references.
Managing the lifetime of dynamically allocated memory and the objects residing in it is one of the challenges that can be hard to do right. It is usually handled by assigning […]