Bjarne Stroustrup, the creator of C++, published objections to the conclusions made in the NSA report, which recommended that organizations move away from programming languages like C and C++ that place memory management in the hands of developers, in favor of languages such as C#, Go, Java, Ruby, Rust, and Swift, which provide automatic memory management or perform memory safety checks at compile time.
According to Stroustrup, the languages mentioned in the NSA report do not actually surpass C++ in important applications from his perspective. In particular, the C++ Core Guidelines, developed in recent years, cover safe programming methods and prescribe the use of tools that ensure type and resource safety. At the same time, developers who do not require such strict safety guarantees are left the option to continue using older development methods.
Stroustrup believes that a good static analyzer aligned with the C++ Core Guidelines can provide the necessary safety guarantees for C++ code, requiring significantly less effort than transitioning to new safe programming languages. For instance, most of the Core Guidelines recommendations have already been implemented in the static analyzer and memory safety profile included in Microsoft Visual Studio. Some recommendations are also addressed in the Clang tidy static analyzer.
The NSA report's focus solely on memory issues has also come under criticism, overlooking many other programming language problems that affect safety and reliability. Stroustrup views safety as a broader concept, with various facets that can be achieved through a combination of coding style, libraries, and static analyzers. To manage the inclusion of rules that ensure type and resource safety, he proposes using code annotations and compiler options.
In applications where performance is more important than security, this approach allows for selective implementation of measures that ensure security only where necessary. Security enhancement tools can also be applied partially; for instance, initially limiting to range checking and initialization rules, and then gradually adapting the code to stricter requirements.
Source: opennet.ru
