Using .NET everyday I’d say use C# if you had lots of GUI work, database work, GDI+, printing, etc… I would not recommend it for the inner loop of a graphics engine or a rendering engine. The exception would be if you needed to keep a project monolingual and your GUI oriented code was already C# based.
If your career involves writing programs for Fortune 500 companies, I’d recommend C# or VB.NET due to configuration supportability and career opportunities. It would come however with a noticeable hit in performance.
A small C++ compiled program can drop right into L2 cache and execute blazing fast. The performance I’m seeing for projects I do solely in C# and VB.NET is maybe 1/2 as fast. The only place I really notice it as a bottleneck is when attempting to get the best frames per second in computer graphics.
While 30 FPS is acceptable since it will fool the human eye, it is nice to start a project with a much higher FPS since you will be adding as much to the scene as possible.
I’d recommend using C++ to create the inner loop of your engine as a reusable object, then use C# for your interface if you really want to use C#. I’ve used VB.NET and Java quite a bit as well.
Staying power? With Java, the speed of most projects I’ve done was laughable… It is hard to prevent a JVM from being a huge unsightly bottleneck. Most Java projects I was on will be rewritten in the next one to three years or retired due to load and performance problems. In contrast, I still use software written in C++ eight to ten years ago and it keeps performing better and better with each new release of cheap PCs.
Dotnet languages have a staying power beyond Java since Microsoft has been doing good RAD runtimes since VB 3.0 (circa 1993). I’m pessimistic about the future of Java with .NET around despite doing Weblogic projects semi-frequently and using JSP and servlets quite a bit.
For comparison, I’ve tested some of the billboard/surface code I’m working on with different compiled versions.
Here are my quick and dirty test results:
Load test: Less users for multi-user system in C#
Stress test: Roughly equal
Volume test: the number of models that can be loaded is slightly higher for C++
Performance test:
-C++ version is running at average 424 FPS
-C# version is running at average 248 FPS (58% as fast)
-VB.NET version is running at average 248 FPS (58% as fast)
The bottleneck is definitely .NET. The code uses the same Direct3D functions which come from a DLL compiled with C++. I’d be interested if others have found the same results.
On the flip side, C# and VB.NET are much more enjoyable for me to program in and I feel that it is a significantly less amount of work. In 30 minutes I have a working app. You can do nearly anything in C# or VB.NET due to the amount of classes in the .NET runtime. It would take you years to do the same types of things in C++ from scratch. I haven’t used Managed C++ enough to have an opinion on it.
If I’m building a metaphorical dog house, I use C# or VB.NET. If I need to build a skyscraper and I have 1-2 months to plan and design, I’ll use C++. When consulting, most companies I work for build lots of dog houses and have never built a skyscraper.