June 23rd, 2006, 12:08 AM
[RESOLVED] C++/CLI and C#
When it comes to developing Windows Forms Applications, what is more powerful out of C++/CLI and C#?Microsoft state on MSDN that C++/CLI is the most powerful .NET Language,but i wish to know what makes it more productive and powerful than C#.
I have also been told that C++/CLI Applications run faster than C# ones, is this true?I dont understand how a C++/CLI Application can run faster than a C# Application when .NET Languages are supposed to be compiled to MIL and run at the same speed
Last edited by Microsoftlover; June 23rd, 2006 at 12:11 AM.
June 23rd, 2006, 01:39 AM
Re: C++/CLI and C#
Both languages are about equally powerful in this context. The biggest strength of C++ is evident when you need to also use OS functionality that is only exposed as native or COM APIs since you can just call them. The biggest strength of C# is that it is a simpler language with a build model that allows for easier tools support.
C++/CLI code tends to be faster for 2 different reasons:
1) Writing identical code and running it on x86 is up to a few percent faster in some cases because we run the optimizer when emitting MSIL code to compensate for some analysis the x86 JIT compiler is not able to do. On x64 the difference is less.
2) Some patterns that are much more natural in C++/CLI like using our deterministic finalization avoid putting undue pressure on the garbage collector and in some cases that can have dramatically positive performance effects. In C#you can obtain the same effect through using blocks or by explicitely calling Dispose in a finally clause, but that code is not the natiral way to write it in C#.
Acting Product Unit Manager
Visual C++ Team
June 23rd, 2006, 02:28 AM
Re: C++/CLI and C#
Thanks, looks like im staying with C++/CLI then..C++/CLI community is slowly getting big aswell even though its only been approx.6 months since C++/CLI's official release.
Click Here to Expand Forum to Full Width
This a Codeguru.com survey!