When and how variables are initialized? - Part 2
Sandor Dargo's Blog
by Sandor Dargo
1w ago
During the last two weeks, we saw a bug related to uninitialized values and undefined behaviour, we listed the different kinds of initializations in C++ and we started to more detailed discovery with copy-initialization. This week, we continue this discovery with direct-, list- and aggregate-initialization. Direct-initalization Direct-initialization initializes an object from an explicit set ..read more
Visit website
When and how variables are initialized? - Part 1
Sandor Dargo's Blog
by Sandor Dargo
2w ago
Recently, I shared a story with you about a bug, about a manifestation of undefined behaviour a compiler upgrade uncovered. There we briefly looked into why a member was left uninitialized, but the topic of initialization deserves a deeper look. Let’s look first at C++ Reference. It matters where you check, but you might even find 8 different types of initialization. I had a bit of a hard tim ..read more
Visit website
Upgrading the compiler: undefined behaviour uncovered
Sandor Dargo's Blog
by Sandor Dargo
3w ago
Not so long time ago, I already mentioned the differences between the different kinds of initializations in my article, Struct Initialization. In the coming weeks, I’m going to revisit the topic. I don’t think I’ll say a lot of new things, but I have fresh inspiration to write about this. So let’s start with the story. I recently upgraded the compiler I used to build a project from Clang 14 ..read more
Visit website
Should we move from fundamental types?
Sandor Dargo's Blog
by Sandor Dargo
1M ago
In this blog post, we are going to discuss the intersection of move semantics and fundamental types. Should we move values of fundamental types? Or can we even move them in the first place? Let’s delve into this. But first, let’s stop for a second to remind ourselves what fundamental types are. In C++, fundamental types, also known as built-in types, are the basic data types provided by the la ..read more
Visit website
C++23: Encoding related changes
Sandor Dargo's Blog
by Sandor Dargo
1M ago
Today, we are going to go through a couple of changes introduced by C++23 where the common theme is encoding. These changes are all related to how the code we write will be encoded by the compiler. Often these papers don’t introduce big changes, simply the common and desirable behaviour got standardized. Yet, these are all important to have code that works as expected and that is portable betw ..read more
Visit website
Tidy First? by Kent Beck
Sandor Dargo's Blog
by Sandor Dargo
1M ago
Let’s start by explaining what tidying means when it comes to software development. Maybe a decade ago, this book would have been called “Refactoring first?”, but the term “refactoring” got inflated when people started to refer to long pauses in feature development as such. Even worse, the most essential part of refactoring - it shouldn’t change the system’s behaviour - is not always respected ..read more
Visit website
Three key philosophies behind C++
Sandor Dargo's Blog
by Sandor Dargo
1M ago
Recently, I had to refresh some training material for software engineers who are not new to programming but are new to C++. It’s a short introduction by all means and as participants are expected to know how to program in a C-like language (usually Java, Kotlin or Python), I don’t have to focus on syntax basis. I decided to follow this agenda for this first part of the course: A little bit ..read more
Visit website
My late discovery of std::filesystem - Part II
Sandor Dargo's Blog
by Sandor Dargo
1M ago
Last week, we started to discuss the main parts of std::filesystem and we discovered how to work with paths, how to navigate up through the directory structure and how to move files and directories around. This week, we are going to see how to iterate over a directory structure based on different needs and expectations. Let’s start by simply listing the contents of a single directory. Iterat ..read more
Visit website
My late discovery of std::filesystem - Part I
Sandor Dargo's Blog
by Sandor Dargo
1M ago
I know that this is not a new topic at all. But this blog in its roots is to document what I learn, and I haven’t used the filesystem library up until a few weeks ago. After the initial encounter, I deliberately spent a bit more time exploring it and I want to share what I found. I don’t want to go over the C++ Reference documentation and I also don’t want to simply repeat what Bartek already ..read more
Visit website
How to write unit tests in C++ relying on non-code files?
Sandor Dargo's Blog
by Sandor Dargo
2M ago
Recently we had a coding dojo with my colleagues where we were working on the second part of the Racing Car Katas, called TextConverter. To sum up the problem, the HtmlTextConverter class takes a filename, reads the file into memory and converts its content into a not-very-sophisticated HTML text. The goal is to test the class and potentially refactor it if you find any good reason for that. I ..read more
Visit website

Follow Sandor Dargo's Blog on FeedSpot

Continue with Google
Continue with Apple
OR