Jonathan Boccara's blog

A new post every Tuesday and Friday morning

5 Tips to Understand Legacy Code

Published January 19, 2018 - 7 Comments

Have you ever struggled to understand a codebase that was bigger than you? Most of us go through this experience more or less often in our career, and this is not a simple thing to do. Maybe you’re in this situation right now. However, even when the code isn’t expressive, there are ways to understand […]

Strong Optionals

Published January 16, 2018 - 5 Comments
Strong optionals

Both strong types and optionals are useful tools to make our interfaces more expressive. Could they be used in synergy to make one benefit from each other? The contents of this post are at an experimental stage. They are laid out here to expose a problem and a possible solution, and as a basis for […]

How is std::set_difference Implemented?

Published January 12, 2018 - 2 Comments
C++ STL set_difference

In last week video, we saw the algorithms on sets that the STL provides. We saw how you can use them to manipulate sorted collections in your code, in an expressive manner. Sean Parent said in one of his talks that we should be as familiar with STL algorithms as possible, and take this to the […]

Strong Templates

Published January 9, 2018 - 8 Comments
Strong templates

Strong typing consists in creating a new type that stands for another type and adds meaning through its name. What would it look like to apply this idea to template interfaces? Disclaimer: What you’ll see in this post is experimental, and it’d be great to have your feedback on it at the end. Strong types for […]

Making Strong Types Implicitly Convertible

Published January 5, 2018 - 0 Comments
Strong types implicit conversions

Strong types and implicit conversions, doesn’t this sound like incompatible features ? It can be argued that they are compatible, in fact. We saw why it could be useful to inherit from the underlying type’s features, and if the underlying type is implicitly convertible to something then you might want to inherit that feature too […]

7 Good Resolutions to Write Better Code This Year

Published January 1, 2018 - 1 Comment
7 Good Resolutions to Write Better Code in 2018

Four… Three… Two… One…   Such are the words that resonated across the planet during the last 24 hours (and you’ll keep hearing them all January!) So let me join my voice in and wish you the best for this new year, that it be full of exciting projects and satisfying achievements. And that you […]

STL Algorithms on Sets

Published December 29, 2017 - 2 Comments
STL algorithms sets C++

If you want to become proficient at manipulating collections in C++, you have to know your STL algorithms. And in particular, you have to know your STL algorithms on sets. The algorithms on sets are less famous than the classical std::for_each or std::accumulate algorithms but they are just as useful, if not more. The algorithms on sets include […]

How to Emulate The “super” Keyword In C++

Published December 26, 2017 - 8 Comments
super c++

A derived class sometimes needs to call the code of its base class and name it explicitly. But for bases classes with a long name, repeating it in the body of the derived class adds a lot of clutter to it. And C++ doesn’t have a super or base keyword to designate “the base class”, like C# and […]

Why Expressive Code Matters

Published December 22, 2017 - 0 Comments
Why expressive code matters

On Fluent C++, we talk a lot about topics related to expressive code: writing expressive code, making existing code more expressive, and how to keep our motivation up and improve even when facing code that is not expressive. But WHY do we do this? Why is expressive code the main technical characteristic of code we […]