.net or c++

Started by
25 comments, last by Saruman 19 years ago
greetings game comunity! I was wondering on your opinion on .net and c++. Ive never programmed in .net before because im a c++ user, but ive been always wondering wich one is better when programming games. Please share your opinions on this topic. thanks
Advertisement
Alright, before this thread gets out of hand (as it inevitably will) I feel this should be said. C# is only on average 2% less fast than C++. There are quite a few commercial games written in C#, and there is a port of the OGRE engine which often runs faster than it's C++ counterpart. So it doesn't matter which language you use. It's really that simple. The only exception would be if you're writing a literally top of the line 3D renderer (unlikely), and it will power a AAA blockbuster title (also unlikely), so just choose which one you more prefer based on language syntax, that sort of thing.
Quote:Original post by nilkn
Alright, before this thread gets out of hand (as it inevitably will) I feel this should be said. C# is only on average 2% less fast than C++. There are quite a few commercial games written in C#, and there is a port of the OGRE engine which often runs faster than it's C++ counterpart. So it doesn't matter which language you use. It's really that simple. The only exception would be if you're writing a literally top of the line 3D renderer (unlikely), and it will power a AAA blockbuster title (also unlikely), so just choose which one you more prefer based on language syntax, that sort of thing.


you know... posts like this make me wonder, why does it seem like 90% of indy game developers use C++? i mean, is it just out of ignorance? or do these people really enjoy managing memory, finding heap corruptions, finding other bugs that couldnt happen in a managed environment, writing crap loads of code themselves, etc...
FTA, my 2D futuristic action MMORPG
Quote:Original post by graveyard filla
Quote:Original post by nilkn
Alright, before this thread gets out of hand (as it inevitably will) I feel this should be said. C# is only on average 2% less fast than C++. There are quite a few commercial games written in C#, and there is a port of the OGRE engine which often runs faster than it's C++ counterpart. So it doesn't matter which language you use. It's really that simple. The only exception would be if you're writing a literally top of the line 3D renderer (unlikely), and it will power a AAA blockbuster title (also unlikely), so just choose which one you more prefer based on language syntax, that sort of thing.


you know... posts like this make me wonder, why does it seem like 90% of indy game developers use C++? i mean, is it just out of ignorance? or do these people really enjoy managing memory, finding heap corruptions, finding other bugs that couldnt happen in a managed environment, writing crap loads of code themselves, etc...


I suppose, then, that you use a managed environment for your games?

I think that I will also switch to C# for my development. The pros outweigh the cons, and I never intend to go commercial anyway. The development time will decrease so rapidly (apparently) that the slight speed difference in the final executable will be worth the effort saved.
Quote:Original post by CodeTitan
Quote:Original post by graveyard filla
Quote:Original post by nilkn
Alright, before this thread gets out of hand (as it inevitably will) I feel this should be said. C# is only on average 2% less fast than C++. There are quite a few commercial games written in C#, and there is a port of the OGRE engine which often runs faster than it's C++ counterpart. So it doesn't matter which language you use. It's really that simple. The only exception would be if you're writing a literally top of the line 3D renderer (unlikely), and it will power a AAA blockbuster title (also unlikely), so just choose which one you more prefer based on language syntax, that sort of thing.


you know... posts like this make me wonder, why does it seem like 90% of indy game developers use C++? i mean, is it just out of ignorance? or do these people really enjoy managing memory, finding heap corruptions, finding other bugs that couldnt happen in a managed environment, writing crap loads of code themselves, etc...


I suppose, then, that you use a managed environment for your games?

I think that I will also switch to C# for my development. The pros outweigh the cons, and I never intend to go commercial anyway. The development time will decrease so rapidly (apparently) that the slight speed difference in the final executable will be worth the effort saved.


Yep, productivity could potentially go off the charts compared to C++. The problem with most new game programmers today (tho I'm one of them) is that they focus on reimplementing the basic algorithms and data structures. Now, I agree these need to be understood, but rewriting such things is a waste of time. What game programmers need now is not to be able to write a quick sort algorithm, but to be able to piece together all the subsystems that comprise a game to make something bigger.

For example, how many threads do you see around here about things such as message systems, or class hierarchies? Granted there are a few, but still very little compared to how many are asking 'What's wrong with my linked list implementation?' or something similar. People are focusing on the wrong things. This is why so few people here ever finish a game. Everybody is working on their awsome "2D Engine", which they most likely won't finish, and thus will not make any games for quite a while.

Anyways, these are just my thoughts, purely opinion.

Edit: I'm not saying C# is better than C++, nor am I saying it's a better choice. I'm simply saying you will be more productive with it than in C++. But if you need pointer arithmetic, or just want it, then there's absolutely nothing wrong with that. Just know you will probably spend more time fixing bugs than writing a game. The only reason I'm still using C++ is because I have an entire messaging system written in it, and I'm too lazy to port it to C#.
Quote:Original post by CodeTitan
I suppose, then, that you use a managed environment for your games?


hah... ironically enough, no, i use C++ for my game development. however, recently i've had to teach myself C# for business programming, and when i started reading some of the toturials on C#, i guess it was like one of those "oh damn" kind of moments [grin].

personally though, i do not regret going with C++, only because its like getting punched in the face over and over. when you finally stop getting punched, everything feels soooo good [grin]. ok, might have been a bad analogy, but what im saying is, once you can do C++, you can do anything.
FTA, my 2D futuristic action MMORPG
Quote:Original post by graveyard filla
you know... posts like this make me wonder, why does it seem like 90% of indy game developers use C++? i mean, is it just out of ignorance? or do these people really enjoy managing memory, finding heap corruptions, finding other bugs that couldnt happen in a managed environment, writing crap loads of code themselves, etc...


Yes "these people" do enjoy managing our memory, finding random bugs and writing crap loads of code ourselves. I've use VB, Java and a little C# (not too much I'll admit) but I don't find any of them half as enjoyable as C++. Infact I find it kind of insulting sometimes because so much is abstracted away that I could handle myself. I know thats the whole point of such languages, but really they annoy me because I'm used to (and like) doing things myself so when i can't it gets frustrating. For GUI applications that I just want to run then sure high level languages rock. But for games when the whole point is getting your hands dirty it seems kind of pointless.

Lots of people complain heavily about the memory bugs, but its actually not that big a deal once your competant (for learners though its hell). I code in both c and c++ for work, and c++ for my hobby code and very rarely do I come up against any memory management bugs. Infact I've never had a "heap corruption" bug, and its usually only at the start of a project that you get any type of memory bugs at all. It does take more practise than say java/c# but once your used to it putting a delete to match every new just becomes second nature. 90% of my time is always spent on phyics and gameplay code which would still happen in a c# game. True it took me alot longer to get compotent with c++ than it would've if I'd started with c# but that gives me a greater sense of achievement which is why I code for fun in the first place!

Also some people don't like being lock into the MS way of doing things. I for one write my code to be portable and run on linux - so that counts out all of .NET even if I was inclined to use it. Also most people still don't have the .NET framework and I don't want to force it people who'd like to view my work. There is also the fact that MS can chop and change .NET at will without telling anyone. They probably won't because everyone would complain but they can. They can even just stop updating it completely and then your code becomes useless.

So those are just a few of the reasons why "those people" choose not to use .NET
kaysik, i agree with you. personally, i feel more comfortable being close to the metal. i feel like i have more control over things... to be honest, i havent even really written anything except basic "hello world" apps in C#. i guess the main problem is, in real life, time == money, so most employers will probably want to go with a higher level language. also, in fake life, e.g. doing your own indy gaming in your spare time, time == reality. the longer it takes you to finish a game, the less likely you will be to finish it. this is why i would consider using something like C# for my next game.
FTA, my 2D futuristic action MMORPG
Quote:C# is only on average 2% less fast than C++
All right... The same is said about Java FOR YEARS. And guess what? It still consumes shitloads of memory and the JITC lag is just plain annoying. I would be very astonished if C# would be any different.
Quote:Original post by noVum
Quote:C# is only on average 2% less fast than C++
All right... The same is said about Java FOR YEARS. And guess what? It still consumes shitloads of memory and the JITC lag is just plain annoying. I would be very astonished if C# would be any different.


You're probably right, but still, for 90% of us gamedevers, does it matter? Probably not. Nobody here is writing anything anywhere near the scale of FarCry or Doom 3. But also, keep in mind the guys who actually are writing FarCry and Doom 3 are incredibly experienced and skilled, and will therefore probably not have much trouble with C++ at all.

Quote:Original post by graveyard filla
kaysik, i agree with you. personally, i feel more comfortable being close to the metal. i feel like i have more control over things... to be honest, i havent even really written anything except basic "hello world" apps in C#. i guess the main problem is, in real life, time == money, so most employers will probably want to go with a higher level language. also, in fake life, e.g. doing your own indy gaming in your spare time, time == reality. the longer it takes you to finish a game, the less likely you will be to finish it. this is why i would consider using something like C# for my next game.


These are totally valid points, and I completely understand. I sometimes feel the same way. These are simply some reasons why C++ might be preferable over managed languages. But still, the difference in productivity can't be denied. So I still stand by my point that which language is left totally to personal preference.

This topic is closed to new replies.

Advertisement