Fundamentals 9 min read

How Bjarne Stroustrup Envisions Safer C++ with Mandatory Guidelines

Bjarne Stroustrup urges the C++ community and the WG21 standards committee to adopt mandatory guideline configuration files, known as Profiles, to improve type and memory safety, while highlighting recent language features, upcoming C++23 and C++26 enhancements, and the broader evolution of the language.

21CTO
21CTO
21CTO
How Bjarne Stroustrup Envisions Safer C++ with Mandatory Guidelines
图片
图片

In a recent ACM Communications article titled “C++ in the 21st Century,” Bjarne Stroustrup, the creator of C++, calls for the adoption of mandatory guideline configuration files—called Profiles—to make the language safer and more type‑secure.

Call for Urgent Action

Stroustrup emphasizes that while the language itself cannot be changed without breaking compatibility, its usage can be improved through enforced guidelines. He has written to the WG21 committee, describing the need for urgent action against unprecedented security attacks on C++.

Mandatory Guidelines and Profiles

He advocates for configuration files that automatically check for common errors such as dangling pointers, out‑of‑bounds accesses, and null‑pointer dereferences. Examples include the “Lifetime” profile in Visual Studio 2019, which validates object lifetimes, and planned “Bounds” profiles that enforce array‑bounds safety.

These profiles are already available as standard features and can be used out‑of‑the‑box, with more profiles forthcoming to prevent type and arithmetic errors.

Modules and Performance Improvements

Stroustrup also highlights modules as a way to simplify code and dramatically reduce compilation times—up to tenfold compared with traditional #include directives.

He notes that most developers can now leverage C++23 features to significantly improve their codebases.

Future Outlook: C++26 and Beyond

Looking ahead, Stroustrup predicts that C++26 will bring enhanced concurrency support, static reflection, contracts, and numerous incremental library improvements, moving the language closer to his original vision of type‑ and resource‑safety.

He stresses that C++ must continue evolving to meet the demands of high‑quality applications across diverse domains.

Conclusion

Stroustrup’s article underscores that C++ is still evolving, with safety and performance at its core, and that developers should adopt the emerging Profiles and other tools to achieve more secure and efficient code.

《C Plus Plus 的设计和演化》一书的封面,来源:stroustrup dot com
《C Plus Plus 的设计和演化》一书的封面,来源:stroustrup dot com
C++ProfilesguidelinesBjarne StroustrupC++23language safety
21CTO
Written by

21CTO

21CTO (21CTO.com) offers developers community, training, and services, making it your go‑to learning and service platform.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.