Jonathan Boccara's blog

A new post every Tuesday and Friday morning

Introduction to Boost Karma

Published February 23, 2018 - 0 Comments

Following up in the series about learning what’s in Boost, let’s get in Boost Karma, that generates strings in a very, very elaborate manner. Too elaborate? Perhaps. But like most of the Boost libraries, even if you don’t end up using them in your production code, it’s still beneficial to know about them. They push […]

On Using Guards in C++

Published February 20, 2018 - 7 Comments
guards C++

Early return statements are a controversial topic across many programming languages. Some people find that they improve readability because they avoid carrying a result variable down the end of a function. And some other people find they constitute a danger because they introduce complexity: with them, a function suddenly has several exit doors. Today I […]

The Right Question for the Right Name

Published February 16, 2018 - 0 Comments
naming

“What’s the right name for this variable/function/class/module?” As programmers, this something we ask ourselves multiple times a day, and that is also a question that comes up often during code reviews. In this video, I’ll share with the question that I use to determine a name for something in code. And often, the answer to […]

To RAII or Not to RAII?

Published February 13, 2018 - 17 Comments
raii

RAII is a central concept in C++, that consists in relying on the compiler to call destructors automatically in certain cases. Putting appropriate code in such destructors then relieves us from calling that code – the compiler does it for us. RAII is an idiomatic technique of C++, but can we use RAII for everything? […]

Introduction to the C++ Ranges Library

Published February 9, 2018 - 2 Comments
C++ ranges

Announcement: This Sunday I’ll be hosting┬ámy first AMA, standing for Ask Me Anything, and I’d love for you to join in! An AMA is an online event where you can ask any question to the host. And the AMA I’ll be hosting is about writing clear code (in particular in C++)! So I will take […]

Lvalues, rvalues and their references

Published February 6, 2018 - 6 Comments
lvalue rvalue references C++

Even though rvalue references have been around since C++11, I’m regularly asked questions about how they work and how to use them. For this reason I’m going to explain my understanding of them here. I think this is relevant to the topic of Fluent C++, expressive code in C++, because not understanding them adds a […]

The Most Vexing Parse: How to Spot It and Fix It Quickly

Published January 30, 2018 - 8 Comments
most vexing parse

Everyone has their little defaults. You know, that little something that they do from time to time and that gets on your nerves, even though they’re otherwise nice people? For C++, one of these little annoyances is the most vexing parse, well, as its name suggests. I think this is a topic related to expressiveness […]

Introduction to Boost Phoenix

Published January 26, 2018 - 7 Comments
Boost Phoenix

With this video, we’re starting a series about learning what’s in the Boost library. Like I discussed in Getting Inspired by Good Code, it is beneficial to know what is in Boost, either to use it or just to expand your horizons about the C++ language. And Boost can expand them pretty far. Knowing what […]

How to Be Clear About What Your Functions Return

Published January 23, 2018 - 9 Comments

What’s in a function’s interface? In most languages, a function’s interface has 3 main parts: the function’s name: it indicates what the function does, the function’s parameters: they show what the function takes as input to do its job, the function’s return type: it indicates the output of the function.

So far, so good. […]

1 2 3 14