Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++/CLI Community

Sort of curious as to how many people actually use C++/CLI? So how many people are using it? Are there specific jobs that people are only looking for programmers under a managed environment? How big is the community around c++/cli? From what I've seen thus far there are quite a few syntax changes, is this something I should learn, as a c++ programmer? Also, is c++/cli, c++.net? I'm pretty ignorant to anything microsoft.

like image 453
Dalton Conley Avatar asked Mar 29 '11 22:03

Dalton Conley


People also ask

Does Visual Studio community have C?

The Visual Studio build tools include a C compiler that you can use to create everything from basic console programs to full Windows Desktop applications, mobile apps, and more.

Is Visual Studio community good for C++?

Visual Studio is the native IDE for Microsoft's platform and in that role it is excellent. It is outstanding for ASP.NET and for C++ targeting Windows.

Where is MSVC compiler installed?

More precisely, the default path where you'll find the compiler is C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin .

Can I compile C in Visual Studio?

c” file name extension as C, and to compile files that have a . cpp extension as C++. As long as your source code file names all end in . c, Visual Studio will use the C compiler (and not the C++ compiler) to compile them.


2 Answers

Just about nobody makes a living programming in C++/CLI every day. Plenty of programmers know how to write a wrapper class, that's what the language is great at. But these are one-off projects, bridging the gap between a legacy codebase and a managed front-end. Much like it is used in the .NET framework, C++/CLI is used in System.Data and PresentationManager to interop with respectively dbase providers and DirectX.

When you know native C++ programming well and have at least been exposed to something like C# and know the fundamentals of the CLR then you'll have little trouble diving in when necessary. Figure about three weeks to get up to speed on the syntax. Mastering it takes longer of course, but not always necessary to get the job done.

like image 142
Hans Passant Avatar answered Oct 29 '22 06:10

Hans Passant


Starting with some of the easier parts of your question first, "Managed C++" is the name of the older interoperability layer for C++ introduced in Visual C++ 2002. To be honest, it was pretty horrible and put me off bothering to look at .Net for ages. For Visual Studio 2005, Managed C++ was replaced by C++/CLI. The syntax is actually pretty straightforward and whilst the final result doesn't exactly look like C++, it's easy to read and it's very similar to C#. Nailing my colours firmly to the mast, I actually quite like using it!

Most use cases of C++/CLI involve wrapping native code, and apart from using for this, I've also used it for a more substantial assembly involving Extended MAPI and Outlook.

In terms of day to day usage of C++/CLI, you'll probably want to take a long hard look at how the dispose pattern should be implemented (look at the ~/! syntax combination). I do find it irritating that boost shared pointers can't be used as member variables in managed classes, so I've been writing my only "delete" statements in years, but it's a small point really.

FxCop works brilliantly on C++/CLI generated assemblies, so you should definitely make use of this as you learn about .Net.

Best of luck!

p.s.

Strictly speaking, I'm not sure this question qualifies as being a valid StackOverflow question, but it is an interesting subject...

like image 34
Adrian Conlon Avatar answered Oct 29 '22 06:10

Adrian Conlon