Visual C++.net vs Visual C#.net

Started by
49 comments, last by Drilian 16 years, 11 months ago
Quote:
I think you're the first person I've ever heard singing the praises of Win32 over Forms. Forms offers MUCH faster development time in almost all cases, and--contrary to your point--.NET in general reduces the number of architecturally inconsistent libraries and APIs, because they are all built into a standard framework.


Man then maybe you and I exist in different worlds. Pretty much any game developer I've ever been associated with or had the chance to discuss platforms with have been against .NET and specifically because of the managed aspect. I agree that consistency is a nice luxury, but unfortunately in this field it's always been my experience that control over resources and performance far outweigh comfort for the programmer. Forms programming is fine for software and smaller games, but when we start pushing the 3D envelope it can be burdensome.

I'm not that old school although I seem to recall the professors trying to push in gc'd/managed as core teaching languages just after I left college a few years back.

To be honest (and maybe this is old guard), I still don't think we have enough memory resources to be as lazy as to completely put our own comfort before the actual performance of the game. I understand your logic about facilitating design in such a manner though. There are definitely a lot of tools being used more regularly to make it that way, but again in my experience memory and performance still take precedence.
Advertisement
Quote:Original post by ejele012
With C# and XNA, what Microsoft call Cross Platform is just that you can write a game that can be run over windows and Xbox 360.
C# and XNA work on two different platforms - that does qualify as cross-platform, and has the nice benefit of one of those platforms being a current-gen console. There are also efforts in the works (see monoxna) to produce a further cross-platform implementation.

C# without XNA can potentially run on plenty of platforms.

Cross-platform capabilities probably aren't something a beginner should particularly be taking into consideration anyway.

Quote:You have more control over C++, you can make unmanaged and managed code with it.
No, you can't. As explained by jpetrie, Managed C++ is a collection of non-standard compiler-specific macros provided with VS2003, and C++/CLI is an independant language. Note also that with that 'additional control' comes an increased potential of mistakes, especially with regards to memory management.

Quote:if you want to use C# with XNA you'll be tied with Microsoft C# Express Edition.
As already mentioned, you only need the C# Express Edition for the actual installation and for deployment to the Xbox360. They do also intend to roll out support for additional Visual Studio products in future.

Quote:A game made with XNA can be run over Linux, BeOs or Mac?
As far as I'm aware it's not possible at present, although as mentioned it may be a possibility in future thanks to Mono XNA. Running on those platforms is in no way required to be considered cross-platform however, the definition is simply that a technology run on more than one platform, so the claim that XNA runs cross platform is genuine. Without XNA C# is capable of running on those platforms.

Quote:Original post by gharen2
The short and simple answer is this: C++ and C# are both perfectly valid choices. For that matter, so is vb.net, python, or pascal. It's all about personal preference. Besides, knowing multiple languages is NEVER a bad thing.
QFE, this is a good answer.

- Jason Astle-Adams

Quote:Original post by thrawn42
To be honest (and maybe this is old guard), I still don't think we have enough memory resources to be as lazy as to completely put our own comfort before the actual performance of the game. I understand your logic about facilitating design in such a manner though. There are definitely a lot of tools being used more regularly to make it that way, but again in my experience memory and performance still take precedence.
And this, friends, is how well intentioned misinformation is created.

Many people simply assume that managed = slow and large, without really thinking about it. Managed code does not mean that it's slower but still fast enough that we tolerate it. It can mean that, depending on precisely what you're doing, but in many cases with competent developers, it is not the case. There are plenty of opportunities for managed code to be as fast or faster than similar native code.

Sadly, "competent developers" is a bit of a hangup. Optimization of native code is well understood by most developers, and that knowledge has been in the general consciousness for some time. Relatively few developers know how to make managed applications lean, fast, and efficient. Things are further complicated because the accessibility of managed languages means a lot of ignorant of incompetent people are writing shoddy code and generally feeding the cultural stigma. Managed code can be blazing fast -- it's just that very few developers know how.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
Quote:Original post by Promit
And this, friends, is how well intentioned misinformation is created.

Many people simply assume that managed = slow and large, without really thinking about it. Managed code does not mean that it's slower but still fast enough that we tolerate it. It can mean that, depending on precisely what you're doing, but in many cases with competent developers, it is not the case. There are plenty of opportunities for managed code to be as fast or faster than similar native code.

Sadly, "competent developers" is a bit of a hangup. Optimization of native code is well understood by most developers, and that knowledge has been in the general consciousness for some time. Relatively few developers know how to make managed applications lean, fast, and efficient. Things are further complicated because the accessibility of managed languages means a lot of ignorant of incompetent people are writing shoddy code and generally feeding the cultural stigma. Managed code can be blazing fast -- it's just that very few developers know how.


There is and continues to be a stigma against GC'd/Managed code when it comes to speed which in the past has been warranted. Both Java and .NET have become faster to use as those platforms were advanced but also as our computers became more equipped to deal with them. So some of that stigma has become unwarranted. And depending on what you're doing, if you take your time you can write 'blazingly fast' code in such an environment. You're right there.

However the choice not to use .NET is not because a lot of developers are ignorant or incapable of understanding how to control a garbage collector, it's because the benefit of managed code is seen as something that's largely beneficial just to the development process and not the end product's performance. In other words, why should we waste time dealing with scheduling garbage collection, when we can manage the memory ourselves, typically in a much more precise fashion and without worrying about performance cost of the managed environment? You can argue about the .NET's API benefits but then again it also comes down to the basic fact that the big white elephant in the room is still there.

I've developed both extensively in C++ and C# .NET as well as Java. However when it comes to games that eat up a lot of resources and CPU time, the benefits of the managed environment are seen as a waste of available resources. They have their uses and are definitely not as slow as rumored, but come on man. Do you actually think the reason a lot of devs decide to stay away from a managed environment is because they're ignorant of the benefits or incapable of fully taking advantage of it?
Quote:Original post by thrawn42
Do you actually think the reason a lot of devs decide to stay away from a managed environment is because they're ignorant of the benefits or incapable of fully taking advantage of it?

Yes. Just look at the replies to this thread. Furthermore, look at some of the very posts by seasoned developers on the topic, which make incorrect conclusions about the performance and viability of managed code, by basing it on code that sucked in the beginning. Not to mention, you don't schedule the GC. It gets scheduled for you based on your usage patterns. In a game, where you shouldn't be performing lots of heap allocations during typical gameplay, you're not likely to hit the GC often. Those times you do hit it will be gen0 collections, which are blazingly fast.

Not to mention you've ignored all the other benefits of being managed and just assumed that it means "GC".

In time the project grows, the ignorance of its devs it shows, with many a convoluted function, it plunges into deep compunction, the price of failure is high, Washu's mirth is nigh.

Quote:Original post by thrawn42
Do you actually think the reason a lot of devs decide to stay away from a managed environment is because they're ignorant of the benefits or incapable of fully taking advantage of it?

Take a look at the previous commentary on C#/.NET (all of them variations of "itz too slow OMG LOL"), then ask that question again.
Quote:Original post by Washu
Quote:Original post by thrawn42
Do you actually think the reason a lot of devs decide to stay away from a managed environment is because they're ignorant of the benefits or incapable of fully taking advantage of it?

Yes.


Well then that resolves that. You against the world and all that good rot.

Quote:
Not to mention you've ignored all the other benefits of being managed and just assumed that it means "GC".


Well do go on to explain what I've 'ignored.'
Quote:Original post by thrawn42
Well then that resolves that. You against the world and all that good rot.


Popular opinion does not determine truth.
Quote:Original post by Drilian
Quote:Original post by thrawn42
Well then that resolves that. You against the world and all that good rot.


Popular opinion does not determine truth.


No but popular use does.

This topic is closed to new replies.

Advertisement