Bjarne Stroustrup on C++/CLI

I hadn’t seen this before; Bjarne Stroustrup’s FAQ has an entry that describes his position on C++/CLI.  It’s worth reading.

In a nutshell, he acknowledges that to use the BCL and write .NET classes in .NET you need language features that C++ doesn’t have.  So you need something like C++/CLI.

But he also makes it clear that you don’t want code that uses C++/CLI extensions scattered throughout your application.

Well, maybe you do.  These features are there for a reason – because they make development easier – but using them ties your application to the CLR.

It’s possible to write a managed application in C++ and still maintain separation between the portable C++ and the .NET specific C++.

And if you’re going to do that, my suggestion would be to write the managed portion in C#. 

If you know C++ you already mostly know C#, and writing the .NET specific portion of your app in C# and calling it from the C++ code makes the separation clear.