Archives de l’auteur : Nicolas Riousset

À propos Nicolas Riousset

Président et fondateur de NeoLegal, développe des solutions logicielles qui facilitent le quotidien des professionnels du droit des sociétés.

When should you rewrite an application from scratch ?

Recently, I had to work on an old C++ builder 4 (1998) application. The IDE couldn’t be installed anymore on Windows 7, there were global variables and singletons everywhere, client-based compilation directives, no separation between UI, business logic and data layer, no class isolation, memory leaks all over the place, compiler failure as soon as the source code got too big, dependencies on obsolete COM objects, etc. A nightmare. It looked like the perfect example of an application that should be rewritten from scratch, and it made me wonder when is it a good time to completely rewrite a product ?

Short answer : Never.
Continuer la lecture

Which command line parser for C++ apps ?

If you need to parse command line arguments in C++, don’t reinvent the wheel, use an existing library. That’s the kind of problem that seems so simple that it’s obvious you’ll quickly hack it. Then you face parsing bugs, spaces within parameters, special characters, optional parameters, config files, etc. Eventually you’ll switch to a library, so save time and do it from the beginning.

Many libraries are available out there for C++ applications, I’ll focus on two of them : Boost.Program_options and GetPot. Continuer la lecture

Basic color scale conversion algorithm

Your app has some pictures/icons, and you’d like to have them in different color scales, for highlighting for example.
Rather than creating a different set of icons, it is cheaper to convert them dynamically to the desired color : redscale, greenscale, or bluescale.
earth
Continuer la lecture

How to enable/disable Windows application Visual Styles at runtime ?

The challenge : update the look&feel of an outdated Borland C++ Builder 4 application, while changing the minimum amount of code, and keeping the same old 1998 compiler… To make things even easier, the new look and feel must be enabled/disabled at runtime.

First, the application UI controls  are straight out of the nineties. To modernize their look without replacing or rewriting them, Microsoft introduced in Windows XP « Application Visual Styles ». The MSDN doc about Visual Styles is not great, but this CodeProject article from Martin Mitáš gives a great overview. Continuer la lecture