Why C# XNA When Everyone Wants C/C++

Started by
164 comments, last by Promit 15 years, 1 month ago
Quote:Original post by Daaark
Quote:Original post by Telastyn
Quote:Original post by Daaark
You are giving me a link to something you are quoting me as having read.
No, I'm giving you the link to a lengthy discussion by intelligent specialists about the presentation you have read (and lamented not having more discussion between 'notable people'). If the link you originally got was the same and not the direct link to the presentation, my apologies.
I only meant it in jest as being double ninja'd. :) I've been skimming the comments there. Interesting stuff.


Heheh, okay, it was hard to gauge from the initial reply. :]
Advertisement
There's always a lot of C++ bashing when these types of threads come up and talking about how the gaming industry needs to move forward and use more modern languages, such as C#. Now I don't proclaim to be an expert; if anything, I'm a beginner. But surely there's got to be a reason, other than backwards compatability with C and it's the de facto standard in the gaming industry, that game companies use C++. I can't imagine the dealing with all of C++'s problems and inconsistencies just for those two reasons alone.

I'm not defending C++ or anything, I just think there must be other reasons that I don't know about.
Quote:Original post by -Datriot-
I can't imagine the dealing with all of C++'s problems and inconsistencies just for those two reasons alone.


You're a game development studio. You have ten C++ programmers, three of which are experienced game development veterans. You have two existing contracts with middleware editors for a 3D engine and a physics engine. A new publisher contract comes in, so you have to start working on a game. You could

  1. Immediately use your existing team and middleware to develop a new game, or
  2. Teach your developers C# (or fire them and hire new developers that use C#), terminate your middleware contracts and look for C#-supported middleware that does the same thing, then start developing a new game.


Changing languages is, for a development studio, equivalent to creating a new team. Few studios can afford that, and even if they could, the financial and human downsides to doing so often dwarf the advantages.
Quote:Original post by ToohrVyk
Quote:Original post by -Datriot-
I can't imagine the dealing with all of C++'s problems and inconsistencies just for those two reasons alone.


You're a game development studio. You have ten C++ programmers, three of which are experienced game development veterans. You have two existing contracts with middleware editors for a 3D engine and a physics engine. A new publisher contract comes in, so you have to start working on a game. You could

  1. Immediately use your existing team and middleware to develop a new game, or
  2. Teach your developers C# (or fire them and hire new developers that use C#), terminate your middleware contracts and look for C#-supported middleware that does the same thing, then start developing a new game.


Changing languages is, for a development studio, equivalent to creating a new team. Few studios can afford that, and even if they could, the financial and human downsides to doing so often dwarf the advantages.

That about sums it up. Although, game studios are more and more using C# for ancillary components, such as the tools development. A good example would be Neverwinter Nights 2's toolset, which is .Net based (although a piece of shit).

I also happen to know (from someone who does work there) that many of the GW2 tools are developed in C#.

You can also see a rather prevalent trend to move away from C++ through the use of scripting languages. Wrapping up lower level components in scripts to allow for much more rapid development, refactoring to C++ for those components that profiling suggests would be better off running at a lower level.

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:You're a game development studio.

of course the 800lb logical flaw is when u replace 'game development' with another software development type, whom have migrated languages over the years.

now ask yourself what differentiates the requirements of eg game development tools, or office software or banking etc vs games

hint - its a reason that dare not be spoken aloud here

sorry about being captain obvious :)
Quote:Original post by zedz
of course the 800lb logical flaw is when u replace 'game development' with another software development type, whom have migrated languages over the years.
Not really[smile]investment banking relies on C++ programs for pricing, because they don't have the time to teach their quants another language or move their existing infrastructure to another system (despite tremendous performance gains to be had, as demonstrated by C#-based grid computing proposals). Physicists also heavily rely on C for most of their computations because that's what they've learned and a department chair will not be bothered to learn another language (let the grad students learn C themselves). In fact, it's a miracle that they moved away from Fortran in the first place. But right now there's a push towards python being made in physics academia, because a physicist would rather spend ten minutes coding an one hour waiting for a result than one hour coding and ten minutes waiting for a result.

So game development is not the only area stuck with tools for financial or human reasons.

Those areas that have migrated languages have usually done so because of a strong push from a language designer. Sun gave a strong push to include java in the average curriculum, supported emerging java development teams that could provide a better product at a cheaper price to their clients, and cleverly set up an alternate development environment so that any client who used a java-based product would have strong incentives to have further developments done in java as well. Microsoft has done the same for .NET, pushing the solution onto both windows developers and web developers, and using its advertising weight to make .NET sound hip in the ears of business decision-makers. And Adobe is doing the same as well, providing free support to those teams that are willing to develop Adobe-based solutions for its clients.
Quote:Original post by sto8qc
Quote:Original post by Drilian

<...>

I (somewhat) apologize for my tone, but I get sick of people continually ragging on something that they obviously know nothing about. The reason that the "C# performance is bad" myth sticks around is because people like you keep spouting your uninformed bullshit like it's truth.

Just stop.

C# performance is not bad. It is just worse than C. Do you have evidence that I'm wrong? Did you do benchmarks, analyzed JIT compiler produced code, analyzed memory usage, etc.?
I'm currious because I did it all once (with Mono 2.0) and I got results that are bad enough compared with C. At least with real time software I wouldn't go with C#/.NET.


Thats not a language comparison though, thats a compiler/VM comparison.

Microsofts .NET is alot faster than mono (up to 10 times faster on some synthetic benchmarks), C++ code compiled with msvc or icc normally (almost always) beats the very same c++ code compiled with gcc (Though the difference here is alot smaller than the difference between MS .NET and Mono), If you target smaller platforms than x86 the difference between 2 C++ compilers from different vendors can be very large. (For the x86 platform most major compiler vendors have pretty good products these days)

The language you choose normally have much less of an impact on performance than your choice of compiler and the settings you choose for that compiler.
[size="1"]I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!
Quote:Original post by zedz
now ask yourself what differentiates the requirements of eg game development tools, or office software or banking etc vs games

hint - its a reason that dare not be spoken aloud here

Do you mean correctness? Bugs in games don't do much harm, whereas in other areas, they can result in catastrophies.
Quote:Original post by DevFred
Do you mean correctness? Bugs in games don't do much harm, whereas in other areas, they can result in catastrophies.
They harm the bottom line. They harm customer confidence.

If you buy 2 games in a row from a company whose main menu's crash you to the desktop without even an error message, you're not likely to ever buy another game from them!

Bugs in games hurt both the customers and the developers.
I understand the reasons for advocating for wider adoption of C# in the games industry but I don't think we do newcomers a service by pushing it so hard. I think it would be much more difficult to move from C# to C++ than vice versa, and starting with C# you don't appreciate or even understand a lot of what the language is doing for you.

I don't think you should bother trying to master C++ unless you're only looking to learn to eventually land a job in the games industry, but it's hardly a terrible first choice for a language. I'd recommend learning just enough to recognize some of it's problems and nuisances before moving to C#.
[size=2]

This topic is closed to new replies.

Advertisement