Why use C++ .NET?

W

Walter

I am a C++ developer, and I've been playing around with
C++ .NET, which apparantly compiles to the same IL as VB!!
Based on this, I'm deciding that I'm going to stick with
unmanaged C++. Does anyone have any good reason to use
C++ .NET over VB or C#? I don't see the point.
 
B

Bo Persson

Walter said:
I am a C++ developer, and I've been playing around with
C++ .NET, which apparantly compiles to the same IL as VB!!
Based on this, I'm deciding that I'm going to stick with
unmanaged C++. Does anyone have any good reason to use
C++ .NET over VB or C#? I don't see the point.


To us who don't know VB this *is* the point. You can produce a .NET
application while still using C++. The compiler guys also claim that
the C++ compiler optimizes the IL a little better, if that is
important.


Bo Persson
(e-mail address removed)
 
C

Carl Daniel [VC++ MVP]

Walter said:
I am a C++ developer, and I've been playing around with
C++ .NET, which apparantly compiles to the same IL as VB!!
Based on this, I'm deciding that I'm going to stick with
unmanaged C++. Does anyone have any good reason to use
C++ .NET over VB or C#? I don't see the point.

Managed C++ is the only language environment that provides a (somewhat)
seamless bridge between the managed and unmanaged worlds, while VB.NET and
C# only offer PInvoke and COM Interop. As Another respondent mentioned, the
C++ compiler also produces more optimized IL than the VB or C# compilers.

In the next major release of the .NET framework & languages, VC++ will have
more advantages that can't be talked about just yet - but I believe that
they'll be compelling.

-cd
 
L

Lee Alexander

I use managed C++ where I need to bridge existing C / C++ code with the
managed world or when I'm going to do lots of win32 stuff that I want
wrapped in a managed interface. I do find the syntax for the managed
extensions a bit weird (but usable). e.g. The C++ for internal is "public
private".

I love using C#, I find it better linked with the environment than C++,
(Auto complete works 99% of the time). When generics comes in (similar to
templates) it will be even better.

I wouldn't touch VB with a barge pole.

Regards
Lee
 
B

Brandon Bray [MSFT]

Walter said:
I am a C++ developer, and I've been playing around with
C++ .NET, which apparantly compiles to the same IL as VB!!

Hi Walter,
I think everyone else has made a good case for advantages of using C++ for
..NET programming, but I do want to clarify one thing from your statement
above. The Visual C++ compiler (version 2002 and version 2003) _can_ produce
the same IL as VB... it doesn't have to. It can still produce the same,
optimized machine assembly code that it has before. It is entirely your
choice to compile towards one or the other.

Cheerio!
 
B

Ben Taylor

Does it compile to the same as VB by default, and if so
what sets this option? Or is it just decided by what code
you write?
 
C

Carl Daniel [VC++ MVP]

Ben said:
Does it compile to the same as VB by default, and if so
what sets this option? Or is it just decided by what code
you write?

If you compile with the /clr complier option, it compiles to IL. If you
compile without /clr, it compiles to x86 machine language.

-cd
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top