Jonathan Boccara's blog

3 Steps to Find the Source of a Bug Quickly

Published September 22, 2021 - 0 Comments

Do you like doing maintenance as a software activity? Most people don’t. Maintenance is often associated with trudging through lines of code with the debugger in a desperate search for bugs, in software that someone else wrote. All in all, maintenance gets the reputation of being an unrewarding activity, with low intellectual stimulation and not […]

How to Define Comparison Operators by Default in C++

Published August 23, 2021 - 0 Comments

Implementing comparison operators in C++ is easier said than done. Indeed, for most types, if we could talk to the compiler we would say something like: “to order them, use a lexicographical order on their members”. But when it comes to writing the corresponding code, things get more complicated. However, a classical technique using std::tuple makes […]

Don’t Let Legacy Code Make You Suffer. Make It Suffer

Published August 4, 2021 - 0 Comments
legacy code refactoring

Feeling like the codebase you’re working on is poorly designed? Wish you could focus on writing good code, rather than trudging through mud code all day long? Would life be easier if only the legacy codebase had a clearer structure? If you answered Yes to any of those questions, be aware that you’re not alone. […]

Extended Aggregate Initialisation in C++17

Published July 17, 2021 - 0 Comments

By upgrading a compiler to C++17, a certain piece of code that looked reasonable stopped compiling. This code doesn’t use any deprecated feature such as std::auto_ptr or std::bind1st that were removed in C++ 17, but it stopped compiling nonetheless. Understanding this compile error will let us better understand a new feature of C++17: extended aggregate initialisation. The […]

How to Return Several Values from a Function in C++

Published July 9, 2021 - 0 Comments

Functions should take their inputs as parameters and produce outputs with their return types. This is the basics of functions interface design. This makes functions easier to understand just by looking at their prototype. It makes functions functional. But C++ only allows to return one value out of a function. What if we’d like to […]