Safe C++ Loses Out To Profiles
Written by Mike James   
Wednesday, 17 September 2025

We do need to do something about C++, but what do you expect when a language is controlled by a committee? Certainly not a revolution.

We all know that C++ has problems. It is simply a language that has grown beyond its initial simplicity. The route map goes something like - take C and add a minimal object-oriented feature, next add anything and everything that makes code easier and more impressive. In C++ there are just too many ways of doing anything, too many gotchas and get out clauses and too many things that don't work as you might expect. 

Every now and again while I'm writing C, I can't help but think that just a small tweak would give me the limited object-oriented features I miss. This must have been the temptation that seduced Bjarne Stroustrup all those years ago. Early C++ was a delight; later C++ is a torture. If only there was some way to cage the monster and turn it back into the cute language it started out as.

This is the basic idea of profiles - unsurprisingly championed by Stroustrup himself. He has long been know for writing clean and relatively safe C++ by restricting his use of the language. As I have said before, after reading any book by Stroustrup I am convinced that C++ is a fine language - until I move on and write my next real C++ program when the doubts descend again. 

What is a profile, but a restriction on how you use C++? For the moment it isn't at all clear how this restriction is to be enforced. There is much talk about static analysis and compile time checks, but nothing that would enforce the rules for the average programmer. Not only is the mechanism unclear, we are still in the early stages arguing about what should be in a safe profile. This may be something so difficult to achieve that it makes the endeavour pointless and never ending. 

Despite all this, the C++ committee voted 30 out of 45 to continue work on profiles. Only 20 out of 45 thought that the prime alternative - to modify the language to create a safe C++ was a good idea. 

The safe C++ proposal is to introduce a safe dialect of the language that could coexist alongside the full, dangerous, C++. The promise is that if you write code in the safe context then your code would have the same safely guarantees as Rust code.

Perhaps it is the mention of Rust that puts the committee off the idea. If you want a Rust-like language then why not program in Rust is a reasonable position. Perhaps the feeling is that C++ has absorbed enough from other languages to have learned a lesson. You can argue that C++ is unsafe because of its acquisitive nature. 

Yet - what exactly would be lost if a safe context was introduced? It would make the subset of C++ that was safe completely clear and it would add syntax such as type qualifiers and the much feared borrow checker...

The rustification of the C++ language would be a good thing, but it seems unlikely to happen.

CppUdacitylogo

More Information

Safe C++

"Profiles'' -- What we need

Related Articles

C++ For The 21st Century

Bjarne Stroustrup Defends C++ As Safe

A Recursive Interview With Bjarne Stoustrup

Bjarne Stroustrup Thinks He Has A Better Way To Do Generics

 

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

 

Banner


GitHub Adds Copilot Agents Panel
28/08/2025

GitHub has added an agents panel that developers can use to delegate tasks to Copilot from any page on github with a simple prompt. 



Oxlint Rust Powered Linter Reaches 1.0
26/08/2025

The first stable version Oxlint, a Rust-powered linter developed as part of the Oxc toolchain, has been released. The new linter promises a 50 to 100 times performance improvement over ESLint along wi [ ... ]


More News

pico book

 

Comments




or email your comment to: comments@i-programmer.info

 

Last Updated ( Wednesday, 17 September 2025 )