class NetworkServiceConfig : public Config<NetworkServiceConfig>{ ... Wait! What? ok ok ... this is not a joke. In fact this is design pattern, and it is called Curiously Recurring Template Pattern CTPR. 🙂 So why anyone would like to do that? Why to derive from a template that takes a Derived class as a template parameter … Continue reading If you want to amaze code reviewer with your awesomeness try this one …
How Modern CMake ease way you mock in C++
Mocking again, as a "response" to my post about how easy mocking in python. So this is my recommendation, of how to perform mocking in C++, reduce impact of testing code to a production code, and keep clean interfaces (everything in contradiction to dependency injection).
So what is this “Modern CMake” exactly?
Building C and C++ projects can be really non trivial stuff, and people are struggling with this topic for years. I found CMake very useful, explicit, easy to use "project builder" . But what is a "Modern CMake" ? Lets dig into this topic ... It is a routine not a feature. A s usual … Continue reading So what is this “Modern CMake” exactly?
This feature of Python makes me love programming again.
If you ask me about one thing that implementing it in C++ is for me tedious i would point "Mocking". And still you need to do this a lot. (I hope I don't need to explain how important is testing and how it involves mocking). There are some common well known ways to do that, … Continue reading This feature of Python makes me love programming again.
6 “Quick Start” lessons of Python for C++ developer
Lesson 1: "All variables are references" Well they are, but it is a bit different than in C++. ❯ python Python 3.9.0 (tags/v3.9.0:9cf6752, Oct 5 2020, 15:34:40) [MSC v.1927 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> a=10 >>> b=a >>> a=20 >>> b 10 # <--- WTF? … Continue reading 6 “Quick Start” lessons of Python for C++ developer