Can C++ .net just as easily (or easier becuase of the environment) make completely unmanaged apps?
Printable View
Can C++ .net just as easily (or easier becuase of the environment) make completely unmanaged apps?
Visual C++ .NET can still make unmanaged C++ (i.e. normal) programs quite easily. In fact, unmanaged C++ is easier than managed :)
How could native C++ be easier than managed?
You don't have to mess around with all the garbage collection, things like that.
Then again I'm biased, because I'm used to all the features of C++, and the fact that I need to use them carefully...its a non-issue really.
The only thing .NET could make slightly easier is making GUIs, threads, or network connections. All three are already handled in other C++ libraries, that are far more portable.
What do you mean by the jump? I use Visual C++.Net 2003 as my programming environment, but I still program traditional C++ with it. Why? Because
a) Managed C++ is mainly meant as a bridge from old code to .Net. Basically it is there to provide an easy way to make class libraries accessible from .Net languages. The core of the .Net framework is probably implemented in Hybrid C++.
b) I learned C++ for it's purpose: to provide a very performant, flexible, portable and reusable programming language. Managed C++ must adhere to the CLS, so some features are not available, namely templates, the cool operator overloading syntax, multiple inheritance (ok, I can live without that) and some other things. The lack of templates truly is a problem. Also .Net is slower than native C++. For portability: there's no sign of the Mono project ever writing a Managed C++ compiler, so that code is bound to MS.
c) .Net is awkward to use from Managed C++. A Java-equivalent of Managed C++ alone would be tricky, with everything being a pointer. Simply writing every variable as a pointer is tiresome. In true Managed C++ you must in addition distinguish between value types and class types (struct and class in C#), handle boxing etc. It's a mess.
d) When I want to write for .Net I use C#. C# was developed for .Net and is extremly easy to use. Give me one good reason to prefer Managed C++ over C#.
I could probably think of one or two more reasons, but I don't think they're necessary ;)
IIRC, struct and class are equivalent in C++, apart from the default permissions.
But not in C#.
C#:
Managed C++:Code:struct S
{
public int i;
public float f;
}
class C
{
public int i;
public float f;
}
Code:__value struct/class S
{
public:
int i;
float f;
};
__gc struct/class C
{
public:
int i;
float f;
};
I didn't know it was so different from C#. I'll stick with native C++ and C#. Thanks.
*slaps self*
Yeah CB, you're right. I misread your paragraph.