Jonathan Boccara's blog

All posts in "Expressive code"

Strong types: inheriting the underlying type’s functionalities

Published a couple of days ago - 0 Comments

This post is part of the series on strong types: Strongly typed constructors: how to give names to several constructors with the same prototype Strong types for strong interfaces: a generalisation of the above, to make interfaces more robust Passing strong types by reference: a particular usage of strong types Strong lambdas: strong typing over generic types Good news: […]

Good news: strong types are (mostly) free in C++

Published a couple of weeks ago - 3 Comments

Strong types are a simple and efficient tool for improving code expressiveness, by letting you express your intentions better to both the compiler and to your fellow human companions. This post is part of the series about strong types, that keeps growing because it is such a rich topic: Strongly typed constructors: how to give names […]

To comment or not to comment? // that is the question

Published 3 weeks ago - 2 Comments

Comments are one of these places where religion meets technology. On one side there are the firm believers that good code is commented code, and on the other side stand the devout to the scarcest commenting chapel. We can’t discuss expressive code and not talk about comments at some point. Is code expressiveness an alternative to comments, or are the […]

Restricting an interface in C++

Published last month - 6 Comments

My colleague and friend Jonathan came up to me the other day with this request: “Jonathan”, he said – you won’t have too many names to remember to follow this story – “Jonathan, how would you go about restricting the methods of an interface? We’ve got a class which we use in a broader context, […]

How typed C++ is, and why it matters

Published last month - 0 Comments

For the third time I attended the meetup of Software Craftmanship in Paris. And like the first time and the second one, it was superb experience again. This meetup lets the participants collectively choose the topics to be discussed. There I proposed to confront, as a group, the various languages that the people in the room knew (the […]

The Pi Day Challenge For The Most Expressive Code In C++

Published a couple of months ago - 8 Comments

Each year, the fourteenth of March is marked by a very special event: Pi Day! It’s called this because in American notation, the 14th of March is 3/14. And during this day, the number Pi is celebrated all over the world in various ways. One notable way to celebrate it is bringing a pie to work or to university. […]

What 70 people came up with on expressive code

Published a few months ago - 7 Comments

Last week held the monthly meetup of Software Craftsmanship in my area. The organizer, Stéphane Bagnier, proposed a very original and interesting schedule for the evening. After a short series of brief and spontaneous presentations, any attendee could propose a topic he found worth spending time talking about, and then everyone got to vote. The 2 topics receiving the […]

How to choose good names in your code

Published a few months ago - 6 Comments

Naming is SO important. If your code is going to be read at least one time — if only by yourself — then names will play a major part in your capacity to work with it. Variable names, function names, class names, names in an interface, all are priceless ways to let your code tell more about […]