Jonathan Boccara's blog

A new post every Tuesday and Friday morning

How to (std::)find something efficiently with the STL

Published a day ago - 1 Comment

This series of posts aims at covering all there is to know in the STL (and even sligthly beyond) about searching. Even though the need for searching for something in a collection is quite a simple concept to comprehend, there are many things to say to cover the topic thoroughly. Even if we’ll remain focused on how to practically […]

Ranges: the STL to the Next Level

Published 5 days ago - 0 Comments

I first wrote this post on Simplify C++!, Arne Mertz’s blog on clean and maintainable C++. You can see the original version of this post here. As seen in a dedicated post, The C++ Standard Template Library (STL) is a fantastic tool for making code more correct and expressive. It is mainly composed of two […]

Know your algorithms: algos on sets

Published last week - 3 Comments

This post is part of the STL learning resource. To get the bigger picture of the STL topics that I intend to cover on Fluent C++, you can go have a look at the dedicated page at fluentcpp.com/STL. The purpose of this series of posts is to give you an opportunity to accumulate — no pun intended! — […]

The importance of knowing STL <algorithm>s

Published a couple of weeks ago - 4 Comments

  STL algorithms are a fantastic set of tool to improve expressiveness and correctness of your code. As outlined in Sean Parent’s famous talk C++ Seasoning the reality is quite straightforward: one needs to know his algorithms. This post explains you how STL algorithms are to be used, and what they can bring to you. Algorithms versus for […]

Super expressive code by Raising Levels of Abstraction

Published a couple of weeks ago - 5 Comments

In this post I would like to propose a technique based on levels of abstraction to transform an obscure piece of code into expressive and elegant one. You’ve been quite a few to take up the Christmas Break Challenge for writing expressive code, by posting a comment on the challenge post or by chipping in on Reddit. […]

Can you write expressive code? – Christmas break challenge

Published 4 weeks ago - 1 Comment

Before you go away on holidays and feast on Christmas and New Year’s eve parties, I want to propose you a challenge about writing expressive code to keep your skills up during the holidays period. I’m going to show you the code for a simple task performed by an application. I’m even going to explain that code to you. […]

Respect levels of abstraction

Published last month - 0 Comments

As software developers, we get to learn many good practices and strive to apply them in our code. For instance we learn the importance of good naming of variables and functions, encapsulation, class cohesion, the usage of polymorphism, concision, readability, code clarity and expressiveness, and many others. What if there was only one principle to […]

Passing strong types by reference

Published last month - 1 Comment

In this last post in the series about strong types, we focus on the need for passing strong types by reference. This is a fairly common use case for strong types, since passing arguments by reference is so common, but I haven’t seen this aspect of strong types treated anywhere else yet. This post is the last one […]

Strong types for strong interfaces

Published last month - 7 Comments

Strong types are a popular topic in the C++ community. In this post I want to focus specifically on how they can be used to make interfaces clearer and more robust. This post in the second one in a series of 3 posts: Named constructors: how to give names to several constructors with the same prototype Strong types […]

Named constructors

Published last month - 4 Comments

This is the first post of a series on the topic of expressive types, that is, types that express what they represent, rather than how they are implemented. By carrying meaning, these types improve the readability and safety of the code. This series is split in 3 steps: Named constructors: how to give a name to […]