Questions and Answers on any aspect of .NET. Now closed.
That's from the programmer's point of view. From the user's point of view, there's not much difference! Except that the Win32 API always exists on a Windows machine, whereas the .NET framework must be installed separately (unless it's Windows Vista). The .NET framework offers some features that don't otherwise exist, e.g. the ability to run an application that you deem untrustworthy (it will run in a sandbox and throw an exception if it tries to use a priviledged API). Those are major differences ... there are plenty of other differences too ... do you have a more specific question?
Yes, performance? Is C++ for CLR just another flavor of .NET language? In other words, does it compile to the same IL code like C# and VB do? I have understood that the difference b/w C# and VB was mainly programmer preference, other than the fact the C# was the system language, and thus more tightly connected to the framework.
Before I fired up VS yesterday and tried to create a C++ App, I had never heard of C++ for CLR. You never see examples of .NET code done in VB/C#/C++, so there has to be some major reason why.
> Is C++ for CLR just another flavor of .NET language?
> I have understood that the difference b/w C# and VB was mainly programmer preference
Yes, but you mean "VB.NET" not "VB": 'VB' is another old-school language.
> You never see examples of .NET code done in VB/C#/C++, so there has to be some major reason why.
You see examples of .NET code done in VB.NET and in C# but not in CLR C++ (or "managed C++" as it's called).
I haven't tried it but I guess that the reason for 'managed C++' is to help you port existing C++ code to .NET.
Visual Basic for the .NET Framework is just called "Visual Basic", without an explicit ".NET" qualifier. The current version is called "Visual Basic 2005".
Also, "Managed C++" was the name for the "managed extensions" for C++ that worked with .NET 1.0/1.1. For .NET 2.0 an entirely new version was devised, called "C++/CLR". That's another set of language extensions, this time standardized.
Re VB naming:
VB6: Called VB, VB6, or even VB.Classic.
VB 1.x: Called VB .NET (note space and capitalisation).
VB 2.0: Called VB 2005.
Tuesday, January 16, 2007
Oops, it's C++/CLI, not C++/CLR... sorry!
Easy porting of C++ code is definitely one reason why Microsoft made Managed C++ and C++/CLI, but there are others. You can use C++ to mix managed & unmanaged code & data in the same .NET assembly. That allows you to embed code that's very fast and hard to decompile, and data that's not controlled by the GC and easily accessible to non-.NET libraries.
Also, the VC++ compiler has better optimization than any other .NET compiler, even when creating IL code. Personally, I think there's also a propaganda reason beyond the technical benefits: C++ programmers won't take a platform seriously unless they can run C++ on the platform...
This topic is archived. No further replies will be accepted.Other recent topics
Powered by FogBugz