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.
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.
21CTO
21CTO (21CTO.com) offers developers community, training, and services, making it your go‑to learning and service platform.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
