Articles & Books

Moving a project to C++ named Modules--Cameron DaCamara

If you can, start using them!

Moving a project to C++ named Modules

by Cameron DaCamara

From the article:

There is a lot of hype (and perhaps restraint) to using modules in projects. The general blocker tends to be build support, but even with good build support there is a distinct lack of useful resources for practices around moving projects to using named modules (not just header units). In this blog we will take a small project I created, analyze its components, draft up a plan for modularizing it, and execute that plan...

How to Parallelise CSV Reader - C++17 in Practice--Bartlomiej Filipek

Would do it the same way?

How to Parallelise CSV Reader - C++17 in Practice

by Bartlomiej Filipek

Friom the article:

At C++Stories (and in my C++17 book) you can find several articles on Parallel Algorithms introduced in C++17. The examples included in those posts were usually relatively straightforward. How about writing something larger?

In this text, you’ll see how to build a tool that works on CSV files, parses lines into sales records and then performs calculations on the data.

You’ll see how easy it is to add parallel execution to selected algorithms and have a performance improvement across the whole application (for example 4.5x on 6 cores, including file loading). In the end, we’ll discuss problems that we found along the way and possible future enhancements.

Here’s the plan:

  • How to build an application that loads CSV files
  • How to efficiently use parallel algorithms
  • How to use std::filesystem library to gather required files
  • How to use other C++17 library features like std::optional, conversion routines - std::from_chars and string_view
  • Where to add [[nodiscard]] and improve code readability

Let’s go...

Template Instantiation--Rainer Grimm

The series continue.

Template Instantiation

by Rainer Grimm

From the article:

Template instantiation is the creation of a concrete function or a concrete class out of a function template or class template. The creation of template instantiation can be implicit (compiler-generated) or explicit (user-provided)...

Adding a book section to Meeting C++

Meeting C++ has now its own C++ book section:

Adding a book section to Meeting C++

by Jens Weller

From the article:

The section offers a listing of current C++ books, currently 14 books by various authors such as Bjarne Stroustrup or Rainer Grimm! More books will be listed in the future, as not all authors had yet time to list their books. July/August is a holiday month after all, though that might give you the time to read a book!

Counting in Iteration Models--Barry Revzin

What is your opinion?

Counting in Iteration Models

by Barry Revzin

From the article:

There’s a really interesting issue pointed out in the July 2021 mailing by way of P2406R0.

Basically, in C++, the iterator loop structure ordering is as follows (I wrote it with a goto to make the ordering more obvious. Note that in C++, we start with the it != end check, not the ++it operation. The point of this ordering is to focus on the transition from one position to the next)...

C++20 concepts are structural: What, why, and how to change it?--Jonathan Müller

Flexibility.

C++20 concepts are structural: What, why, and how to change it?

by Jonathan Müller

From the article:

C++20 added concepts as a language feature. They’re often compared to Haskell’s type classes, Rust’s traits or Swift’s protocols.

Yet there is one feature that sets them apart: types model C++ concepts automatically. In Haskell, you need an instance, in Rust, you need an impl, and in Swift, you need an extension. But in C++? In C++, concepts are just fancy boolean predicates that check for well-formed syntax: every type that makes the syntax well-formed passes the predicate and thus models the concepts.

This was the correct choice, but is sometimes not what you want. Let’s explore it further.

C++ Ecosystem in 2021, JetBrains research

Every year we ask thousands of developers, with various backgrounds from all around the globe, dozens of questions, which we have localized into many different languages. We then clean, weigh, and process the data carefully, and validate it against other data sources. Our goal is to extract the key trends, which we will present through infographics to the public. This data is used across JetBrains to help our team make the right decisions on both global and product-levels. We are happy to share this data with the community so we can all thrive together!

C++ Ecosystem in 2021

by Anastasia Kazakova

The article shares the recent findings and the comments from Matt Godbolt (creator of Compiler Explorer) and Andreas Kling (creator of SerenityOS):

  • In 2021, 1 in 5 C++ developers are using the latest officially signed C++20 standard even though it’s not yet fully supported in all major compilers!
  • Top-3 C++20 big features and how many developers plan to adopt them soon: 48% for Modules, 46% for Concepts, and 33% for Coroutines.
  • The majority of C++ developers prefer code analysis tools bundled into their IDEs.
  • Top-3 most popular build systems in C++ through the last 5 years is CMake, Makefile, msbuild.
  • A third of developers not writing any unit tests at all.

C++ is awesome, here's why...--Vinit Jogani

What do you think?

C++ is awesome, here's why...

by Vinit Jogani

From the article:

C++ is, hands down, one of the most misunderstood languages in software developer pop culture today. People often compare it to C because it is a "low-level" language. Consequently, it has received a reputation of being an esoteric language that only the performance paranoid care about. This is far from true. I have been programming in C++ as my primary language for a while now and the developer experience is actually really good -- much better than I had imagined it would be.

In this article, I want to debunk some common myths about C++ that I heard before I started using it. Then, I want to talk about the actual superpowers that C++ provides you that most other languages do not...