Boosting C++ Performance with Folly

The Folly library, developed by Facebook, is a collection of reusable C++ library components designed to complement the C++ standard library and boost the performance of C++ applications. Folly focuses on efficiency, providing highly optimized components that are particularly useful in performance-critical applications. Here are some key aspects of performance in the Folly library:

Continue reading “Boosting C++ Performance with Folly”

Another big tech company join the move away from C++ initiative, How we can stop this migration process?

Background

2011 marked the renaissance of C++, driven by the release of C++11 which introduced numerous features to modernize the language, such as lambda expressions, smart pointers, and a more efficient standard library. However, a decade later, major tech giants like Google, Microsoft, Amazon, Apple, and Meta are initiating processes to migrate away from C++. This shift highlights growing concerns about memory safety and the evolving landscape of systems programming.

Just recently there’s another big company joining the Moving away from C++ initiative. it concern Apple that recommend to replace C++ with Swift.

One could argue that the issue lies not with C++ itself, but with the developers using it. However, the reality is that big companies are shifting away from C++.

Continue reading “Another big tech company join the move away from C++ initiative, How we can stop this migration process?”

According to Tiobe C++ surpasses C for the first time in history, The Streisand Effect works :)

In the world of programming languages, C++ has long been a staple, valued for its power and performance. However, it’s also been the subject of significant criticism over the years. Interestingly, these criticisms often have an unintended consequence, making C++ even more popular—a phenomenon known as the Streisand Effect.

Recently, C++ faced widespread criticism, with even the White House advising against its use. Ironically, this led to an increase in its popularity. According to TIOBE, C++ has surpassed C in popularity for the first time in history.

Continue reading “According to Tiobe C++ surpasses C for the first time in history, The Streisand Effect works :)”

Understanding Small String Optimization (SSO) in std::string

In the world of C++ programming, efficient memory management is crucial for optimal performance. One fascinating feature that many modern implementations of std::string offer is Small String Optimization (SSO). This clever optimization can significantly enhance the performance of string operations by minimizing heap allocations for small strings. Let’s dive into what SSO is, how it works, and why it matters.

Continue reading “Understanding Small String Optimization (SSO) in std::string”

C++ creator rebuts White House warning, but there’s no smoke without fire :)

In a March 15 response to an inquiry from InfoWorld, Stroustrup pointed out strengths of C++. “I find it surprising that the writers of those government documents seem oblivious of the strengths of contemporary C++ and the efforts to provide strong safety guarantees,” Stroustrup said. 

And Stroustrup cited a fact about the origin of the issue :

There are two problems related to safety. Of the billions of lines of C++, few completely follow modern guidelines, and peoples’ notions of which aspects of safety are important differ.

This highlights a significant problem with C++. When any programming language permits the execution of potentially harmful actions, it shouldn’t come as a surprise that a considerable portion of developers may misuse it.

And when confronted about writing bad code, developers may offer various arguments to justify their actions, though these are often excuses rather than valid reasons:

Continue reading “C++ creator rebuts White House warning, but there’s no smoke without fire :)”

What attempts have been made to bring memory safety to C++?

C++ is a powerful and widely used programming language known for its flexibility and performance. However, one of its historical drawbacks has been the lack of built-in memory safety features, which can lead to various types of memory-related bugs such as buffer overflows, dangling pointers, and memory leaks.

This is a known issue that has persisted for decades, and numerous attempts have been made to find a solution. Unfortunately, none have succeeded.

What has been done in the past to enhance memory safety within the language?

Continue reading “What attempts have been made to bring memory safety to C++?”

Exploring C++ Coding Standards: Cert, Misra, Autosar, and CWE.

C++ coding standards are essential for any software engineer to ensure the software being developed is high quality, secure, and robust. They provide guidelines for software development, so it’s crucial to be familiar with them. In this blog post, we’ll explore four major C++ coding standards supported by CppDepend.

Continue reading “Exploring C++ Coding Standards: Cert, Misra, Autosar, and CWE.”

Are C++ and Java similar?

C++ and Java are two of the most popular programming languages in the world. Both are widely used for developing a variety of applications, ranging from desktop software to mobile applications, and from enterprise systems to gaming engines. Due to their popularity, many developers often wonder if C++ and Java are similar. In this blog post, we’ll take a closer look at these two languages and compare their similarities and differences.

Continue reading “Are C++ and Java similar?”

10 Essential Best Practices for Writing High-Quality C++ Source Code

Writing high-quality code is critical to the success of any software project, as it affects the reliability, performance, and maintainability of the code. In this blog post, we will discuss 10 essential best practices included in CppDepend for writing clean and efficient C++ source code. These best practices cover various aspects of coding, such as naming conventions, error handling, memory management, and more. Whether you are a beginner or an experienced programmer, following these best practices will help you write better C++ code and make your projects more successful.

Continue reading “10 Essential Best Practices for Writing High-Quality C++ Source Code”

Optimize Memory in C++: Doxygen Case Study

When the processes running on your machine attempt to allocate more memory than your system has available, the kernel begins to swap memory pages to and from the disk. This is done in order to free up sufficient physical memory to meet the RAM allocation requirements of the requestor.

Excessive use of swapping is called thrashing and is undesirable because it lowers overall system performance, mainly because hard drives are far slower than RAM. Continue reading “Optimize Memory in C++: Doxygen Case Study”