The majority of code executed on a Windows PC is developed in C++, so it’s expected to encounter more issues in C++ code.

Recently, numerous articles have highlighted issues in C++ code, and even the White House has discouraged the use of C++ in favor of promoting Rust. However, does this perspective consider the extensive use of C++ compared to other programming languages? In this post, we will explore the fact that the majority of code executed on a Windows PC is developed in C++. What if most of this code were developed in Rust, C#, or Java? Would we still have the same incredible user experience we enjoy today? Let’s delve into this question and examine the potential implications.

The usage patterns of Windows users vary widely, but several key activities dominate their screen time. We can enumerate:

Continue reading “The majority of code executed on a Windows PC is developed in C++, so it’s expected to encounter more issues in C++ code.”

Explore a flexible C/C++ SonarQube plugin based on CppDepend.

Both CppDepend and SonarQube are static analyzers that offer a rule-based system to detect problems in C/C++ code. However, the CppDepend default Rules-Set has very few overlaps with the SonarQube rules

Basically, the SonarQube rules are good at analyzing what is happening inside a method, the code flow while the CppDepend code model, on which the CppDepend rules are based, is optimized for a 360 view of particular higher-scale areas including OOP, dependencies, metrics, breaking changes, mutability, naming…
Continue reading “Explore a flexible C/C++ SonarQube plugin based on CppDepend.”

Chasm Theory: Exploring C Longevity, C++ Rebirth & Python’s Rise

How many times do you read “C++ is dead” or “Is the C programming language still used?”, but in the reality they still very popular.

And how many times we read “WOW this newcomer programming language is the best”, but after few years nothing really happens and the new language decrease in popularity. However, there are some exceptions, the most interesting one is python which rise from a not widely used scripting language to a very popular programming language. Continue reading “Chasm Theory: Exploring C Longevity, C++ Rebirth & Python’s Rise”

Write Efficient C Code: Learn from Linus Torvalds

Every project has its own style guide: a set of conventions about how to write code for that project. Some managers choose basic coding rules, others prefer very advanced ones and for many projects, no coding rules are specified, and each developer uses his style.

It is much easier to understand a large codebase when all the code in it is in a consistent style. Continue reading “Write Efficient C Code: Learn from Linus Torvalds”

John Carmack: A C++ Programming Legend

Have you already seen a basketball or a soccer player plays a simple yet effective game to such a point that you say: Why couldn’t everybody play like him, he uses only easy techniques?

And as C++ programmer I had the same remark when exploring the John Carmack source code. It’s so simple, we wonder why we can ‘t develop like him.

Let’s explore some Doom3 source code choices and try to understand why the code even if it’s simple, it’s very efficient.

On November 23, 2011 id Software maintained the tradition and it released the source code of their previous engine. This source code was reviewed by many developers, here’s as an example of Doom3 feedback from fabien (orginal source): Continue reading “John Carmack: A C++ Programming Legend”

C++20 Concepts: Eliminating Generics Paradigm Drawbacks

As Bjarne Stroustrup points out, “C++ is a multi-paradigmed language.” It supports many different styles of programs, or paradigms, and object-oriented programming is only one of these. Some of the others are structured programming, and generic programming. In the last few years C++ experts like Andrei Alexandrescu, Scott Meyers and Herb Sutter promotes the uses of the generic programming and they qualify it as Modern C++ Design.

Here’s what say Andrei Alexandrescu about the Modern C++ design:

Modern C++ Design defines and systematically uses generic components - highly flexible design artifacts that are mixable and matchable to obtain rich behaviors with a small, orthogonal body of code.

Three assertions are interesting in his point of view: Continue reading “C++20 Concepts: Eliminating Generics Paradigm Drawbacks”

The Key to Successful OOP C++ Project: Stable Abstractions

Robert C.Martin wrote an interesting article about a set of metrics that can be used to measure the quality of an object-oriented design in terms of the interdependence between the subsystems of that design.

Here’s from the article what he said about the interdependence between modules:

What is it that makes a design rigid, fragile and difficult to reuse. It is the interdependence of the subsystems within that design. A design is rigid if it cannot be easily changed. Such rigidity is due to the fact that a single change to heavily interdependent software begins a cascade of changes in dependent modules. When the extent of that cascade of change cannot be predicted by the designers or maintainers the impact of the change cannot be estimated. This makes the cost of the change impossible to estimate. Managers, faced with such unpredictability, become reluctant to authorize changes. Thus the design becomes rigid.

And to fight the rigidity he introduces metrics like Afferent coupling, Efferent coupling, Abstractness and Instability. Continue reading “The Key to Successful OOP C++ Project: Stable Abstractions”

C++ Standards and Best Practices: The Perfect Combo

C++ has been stagnated for many years, and many developers were confident that the language would have the same destiny as Cobol, Fortran, and VB6.  On the contrary and against all odds, C++ is reborn from its ashes and the new standards are importantly changing how the language is used.

The evolution of C++ by adding many interesting features does not mean that c++98 standard was a bad standard. Indeed, it gives us many interesting features to develop all kinds of applications. We can enumerate many well-developed old C++ projects, where the code is easy to maintain and evolve. Continue reading “C++ Standards and Best Practices: The Perfect Combo”