Even the White House wants you to abandon C and C++, It’s time to focus on C++ safety and join the Bjarne initiative.

The C and C++ languages are no longer favored by the highest American authorities. Indeed, the White House wishes for developers to use memory-safe languages. In this report published on Monday, the Office of the National Cyber Director (ONCD) of the White House invites developers to reduce the risk of cyberattacks by using languages without memory vulnerabilities. IT companies “can prevent the introduction of multiple vulnerabilities into the digital ecosystem by adopting secure languages,” the presidency said in a statement. It refers to those that are protected against buffer overflow, out-of-bounds reads, and memory leaks.

Continue reading “Even the White House wants you to abandon C and C++, It’s time to focus on C++ safety and join the Bjarne initiative.”

Are you curious to know where the move feature is used in your C++ projects, on your behalf?

Move semantics is a feature introduced in C++11 that allows more efficient transfer of resources (such as dynamic memory) from one object to another. It addresses the inefficiencies associated with deep copying objects, especially large ones, by allowing objects to “steal” the resources of other objects when possible, rather than duplicating them.

Before C++11, when you assigned one object to another, a copy constructor or assignment operator would be invoked, resulting in a deep copy of the object’s data. This process could be expensive, particularly for large objects or those containing dynamic memory allocations. This feature is particularly useful in scenarios where performance optimization is critical, such as in high-performance computing, game development, and resource-constrained environments.

Move semantics introduces the notion of “rvalue references” and a new concept called “move constructors” and “move assignment operators”.

Here’s how it works:

Continue reading “Are you curious to know where the move feature is used in your C++ projects, on your behalf?”

C++ is now a feature-rich language, Be aware of OverEngeniering

Being aware of overengineering is crucial when working with a feature-rich language like C++. Overengineering occurs when developers introduce overly complex or unnecessary solutions to a problem.

C++ developers could be attempted to use as possible the new features introduced by the new standards. which makes the code finally more complicated than it must be.

Here’s an example to show how C++ metaprogramming can be used to create a type-erased container with arithmetic operations that are evaluated at compile time. While this example show the power and flexibility of C++ metaprogramming techniques. it might seem complicated due to the use of templates, concepts and constexpr functions:

Continue reading “C++ is now a feature-rich language, Be aware of OverEngeniering”

Proposal for the next C++ standards

Modern C++ refers to the evolution of the C++ programming language beyond its original design principles, incorporating newer features, idioms, and best practices that have emerged since the language’s inception.

C++ is standardized by the International Organization for Standardization (ISO). C++ standards are typically released every few years, bringing new features and improvements to the language.

Continue reading “Proposal for the next C++ standards”

Average experience of active C++ development Poll

C++ has a steep learning curve compared to some other programming languages. Its syntax and concepts can be complex, especially for beginners or those transitioning from higher-level languages. C++ may not be as beginner-friendly as some other languages, it offers unparalleled power, flexibility, and opportunities for those willing to invest in learning and mastering its intricacies. 

The level of experience, particularly with active development spanning more than five years, often correlates with a deeper understanding of C++ and its capabilities. Developers who have been actively working with C++ for an extended period tend to have a comprehensive knowledge of the language’s features, nuances, and ecosystem, enabling them to leverage its power effectively in various applications.

Continue reading “Average experience of active C++ development Poll”

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”

Being a Productive C++ Developer Without Internet

As developer, How many times during a day you need to ask google for something related to your work? How to use a library? Is there a fix for an encountered problem?

Maybe the answer is at least once a day.

Currently and as developers, the internet saves us a lot of time. Whatever the problem you have, just search the right keywords in google and instantly and in many cases you have a result that matches your need. Continue reading “Being a Productive C++ Developer Without Internet”

C++ Algorithm Evolution: A Historical Flashback

Before the initial standardization in 1998, C++ was developed by Bjarne Stroustrup at Bell Labs since 1979, as an extension of the C language as he wanted an efficient and flexible language similar to C

In 1983, “C with Classes” was renamed to “C++” , adding new features that included virtual functions, function name and operator overloading, references, constants, type-safe free-store memory allocation (new/delete), improved type checking. Continue reading “C++ Algorithm Evolution: A Historical Flashback”

Learn Design Patterns from RigsOfRods Game Project

The majority of developers have already heard about the design patterns, GOF(Gang Of Four) patterns are the most popularized, and each developer has his way to learn them , we can enumerate:

  • Reading a book.
  • From web sites.
  • From a collegue.
  • Doing a training.

Regardless of the method chose, we can learn by heart the patterns and spent hours to memorize their UML diagrams, but sometimes when we need to use them in a real project, it becomes more problematic. Continue reading “Learn Design Patterns from RigsOfRods Game Project”

Learn from Old Games: Prince of Persia & Doom3

Currently many mature libraries and frameworks exist for each programming language and many advanced features were added to the languages. But what about the old projects where the language features were not advanced as now and no many mature libraries existed yet?

Let’s explore some old well implemented projects and discover how they are implemented. Continue reading “Learn from Old Games: Prince of Persia & Doom3”