All posts in "Expressive code"

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 - 18 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? […]

Understanding lvalues, rvalues and their references

Published February 6, 2018 - 7 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 […]

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

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

  [A Russian translation of this article is available on howtorecover.me – courtesy of Vlad Brown]   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 […]

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 […]

More Tips On Naming

Published December 15, 2017 - 0 Comments
More tips on naming

Getting naming right is crucial to convey your intentions through code. Indeed, the compiler doesn’t care if your names are clear enough. It is just for the people who work with you. And that includes you. The clarity of the names in a piece of code has a strong impact on how easy it is […]

Make Your Functions Functional!

Published December 8, 2017 - 2 Comments
functions functional inputs outputs

A function takes input and produces outputs. Simple, right? If so, how come that a lot of functions in C++ code don’t look that way? And how to overcome those difficulties to make them look like proper functions and show a clear interface? This is the subject of this week’s video: Don’t want to miss […]