C++ vs C# some infos
i have a question from a windows developer (winapps)
what are c++ over c# in winapps (i;m using c# & blend and making some cool winaps - beginner level) all the people say c++ is best for that but i hear that there is no suport for C++(C++\CLI for XAML ) can someone tell me excatly the benefits of c++ over c#.
C++ translates very cleanly to assembler.
That means that it's possible to create tighter, faster programs and libraries than you can create in .Net. Because it doesn't have GC, that means that you get very repeatable performance. You don't need to distribute .Net. You don't need to worry about boxing, unboxing, and similar performace issues when interfacing with some OS calls and legacy code.
It has translators to almost everything, so you can write libraries that work with Linux, MacOS, etc. with little effort.
It doesn't support WPF/XAML directly, but it does support MFC, and you can create the front end with C#/WPF/XAML and make calls to C++/CLI or even native C++.
The big downside (for me) is that C++ is pretty static. The new version of C++ won't be ratified until 2009 at the earliest. You won't see the new features until probably 2010 at the earliest. Some things like support for multiple inheritance aren't possible in C++/CLI. I don't know when/if they'll support LINQ or yield. I suspect that C++/CLI will always be a couple of years behind the power curve, which in some ways is a comfortable place to be as a commercial programmer, but I would like to be able to use some of the new features of C#.
The recent posts by the developers seem to indicate that they want to focus their limited resources on Native support, and interoperability. I can understand their need to do that, but it does make it less attractive as a language for me personally, since I would like to be able to use some of the new features. Running LINQ against objects, the foreach yeild construct, and using XAML for the UI are particularly appealing features.
If you're doing windows applications, C# is a better choice for you for now. If you were doing things tightly coupled to the hardware, or tighly coupled to the OS, then you would want to use C++. For the forseeable future, you will probably see C++ used for device drivers and utilities like WinZip.
Ralph