Home
Sandor Dargo's Blog
Cancel

The 4 use of using in C++

When I write code I don’t only want to write code that is correct. I also want to write code that is understandable, and maintainable. I want to deliver code that is easy to read not only for the c...

The infamous bug of range-based for loops

Imagine that you used a feature of your favourite language without fear. Imagine that you used that feature endlessly, without having a second thought. You even promoted it in conversations, in cod...

Beautiful C++: 30 Core Guidelines for Writing Clean, Safe and Fast Code by J. Guy Davidson and Kate Gregory

If you are familiar with the Pluralsight courses of Kate Gregory, you won’t be surprised by the name of this book. While many consider C++ a complex language that always results in difficult to rea...

My first work experience with C++20

I joined a new team recently. We have our own internal microservices as well as libraries. While for microservices we support one main branch, for libraries we do have to support at least three, in...

Use strong types instead of bool parameters

There are some recurring themes in code reviews. Experienced reviewers often already have a template of comments somewhere for such recurring patterns. Sometimes only in the back of their minds, bu...

Storing references of pointers in containers in C++

This article is about the problem of storing vectors in a container and a bug I faced recently. Many would quickly find the conclusion that you should not store raw pointers, but you should work ...

Beyond Order: 12 more rules for life by Jordan B. Peterson

In his first book, 12 Rules for Life: An Antidote to Chaos, Jordan B Peterson focused on the consequences of too much chaos in our lives and how to make it better, how to bring our lives more into ...

The Employee-Company triangle

After having read the title, you must think I forgot something. How can two vertices (the employee and the company) form a triangle? The answer is simple, the employee takes up two of the three ve...

C++ basics: Pointers vs iterators

Do you sometimes feel that you cannot explain the most basic things of a language you work with? You’re asked a simple question and suddenly you can only say “eeeeeeeh, I have to check, sorry.” Do...

Mocking non-virtual and free functions with gMock

Last time we started to discover gMock and we went into details regarding how we can mock virtual functions. We saw how to indicate that a function is to be mocked, how to provide a canned behaviou...