Skip to main content
GameDev.net gamedev.net
🔒 Locked

Is C++ over-used in amateur game development?

Started by graveyard filla Dec 10, 2005 at 4:57 PM 193 replies 48.6k views
Original Post
graveyard filla
graveyard filla
Hi, Please, before getting any panties in a bunch, this is *NOT* designed to be a flame war or whatever. I have been pondering this question in my head for a while now, and am genuinely interested in what other people think. If this turns in to a flame war or whatever, then so be it, let the thread be closed. But I really would like to hear what other peoples opinions are on this. Do you think C++ is over-used for amateur game developers? It seems like the majority of people start out with C++, and then wind up sticking with it. The reason this bothers me is because I can't help but to think of how much farther I would have gotten in my one "big" project, if I had not used C++. ALL the time I spent writing code that has already been written in C#, all the time I spent debugging code that wouldn't even compile in C#... all the time I spent with the headaches and little things in C++ that just don't exist in C#. The bottom line is I honestly think I would have gotten much further in my game if I had used C# instead of C++. And I can't help but to think that this is a flaw in the teaching by people in the amateur game development community. Now please, yes, everyone is different. And of course the majority of people here will preach "use the best tool for the job", and "use what YOU like best", etc., to newbies. But... the majority of questions / answers / articles are for C++, and that is where most help is found... this in itself encourages people to start with C++... I mean... a newbie will come here and see all this and think "man, all these people use C++... this must be the right thing to do". I know this is probably exactly what I thought at first.. I don't know, just looking for your opinions here....
Fruny -- Fixed misspelling of 'amateur', which was driving me mad. [Edited by - Fruny on December 11, 2005 12:23:56 PM]
FTA, my 2D futuristic action MMORPG
Promit
Promit
I say yes, for all the same reasons you just mentioned, and it's why I'm stopping all of my hobby work in C++ after having used it for 5 years and being deeply familiar with the language, and moving to C#/MDX. Personally I think the worst decision I ever made was to spend time working with C++ and OpenGL. What a waste of time on both counts.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
graveyard filla
graveyard filla
Same here... If I ever found the time / motivation to get back into game development, I don't even know what I would do. I think I would honestly think about scrapping the thousands and thousands of lines of code I have written for my game, and start fresh, in C#. Odds are it would take less time then continueing from where I left off......

I know people are gunna take this too seriously, but C# is like a version of C++ that actually works [grin]. After I discovered it, I couldn't believe how many DAYS and MONTHS of my time were completely wasted.... pretty much killed any little bit of motivation I had left to finish my game.
FTA, my 2D futuristic action MMORPG
iequalshane
iequalshane
There are plenty of libraries out there for C++ that you could have used instead of reinventing the wheel. I think too many new programmers get into the habbit of writing code that already exists instead of using what is already freely available. This is not an issue of them using C++.
Roboguy
Roboguy
I agree. Although, as another poster said, the re-inventing the wheel isn't entirely a problem with C++ itself. The main issue is that it is low-level compared to C#, Scheme, Python, Boo, Haskell, etc. This tends to make people work on a lot of boilerplate code or search for libraries to help. It also makes it more easy to make certain types of errors (particularly those which result in crashes, like null-pointer accesses). With some of these problems, of course, you can do things to help prevent them, but that's one more thing you have to learn how to do and use which leads to an increase in code size and a decrease in readability (in some cases) which wouldn't be necessary if it was higher-level. In my opinion, more people should be using higher-level languages (my current favorites are Scheme, Python and Haskell in no particular order), which is why I suggest them when I see someone asking which language to use.
Jubulani
Jubulani
My personal view on this issue, and the reason I use C++ in my projects, is not because 'Its the best tool for the job', but because I want to learn C++.

For getting a game out the door, yes, I, and I think most people would agree C# or Java or maybe Python or Ruby would be better choices from a productivity standpoint, and if your game is never going to be absolute top of the line graphics wise, most of the advantages of C++ are lost. However, I use C++ in order to get better at it.

I'm at uni atm, and when I finish, I want to get a programming job, maybe at a games company, maybe at Microsoft or Intel, maybe at some other company that has a solid programming department. And good knowlege of C++ will be a big plus when applying there, whether I use it on the job or not.

Learing C++ from books, or tutorials will never replace actually having to use it in a medium sized project.

To summarise, for an indie developer trying to sell a game, imo C++ is probably not the best choice. But there are lots of other reasons people use C++, and some of them are certainly valid.

N.B. My opinion only, feel free to disagree
iMalc
iMalc
I think many people stick with C++ because they see C# as merely a way for MS to control yet more areas of computing?

I'd rather use D.
Promit
Promit
Quote:
Original post by iMalc
I think many people stick with C++ because they see C# as merely a way for MS to control yet more areas of computing?
A handful of morons, yes. Many, I hope to god not.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
jsgcdude
jsgcdude
I totally agree, that's why I gave up on c++ a couple of years ago. It has a whole entire raft load of features I'll never use.

Note; I'd like to see the origional poster change all references to a specific language to something generic, like 'language X'; The specifics don't matter. There are MANY languages around that are much more productive than c++.

I'm also surprised this hasn't turned into a flame war, yet.....
------------------
PantherBoy
PantherBoy
My view is that c++ is the most valuable to learn and the most powerful. Particularly if you plan to do any console game engine coding c/c++ are necessities.

C# is very good if you defiantly want to stick to a windows platform but a component written in c++ is most easily usable in other platforms\languages if designed correctly. I use c# quite a lot for tools work were speed is not as critical.

However I do really think for higher level purposes like game mission design etc that scripting languages like lua and maybe python are massively beneficial.
Vincent Wolf
Vincent Wolf
Quote:
Original post by iequalshane
There are plenty of libraries out there for C++ that you could have used instead of reinventing the wheel. I think too many new programmers get into the habbit of writing code that already exists instead of using what is already freely available. This is not an issue of them using C++.


Agree, especially when one can find well written, useful and free libraries. There is the Boost library to name one http://www.boost.org.

Ravyne
Ravyne
I tend to agree as well. For beginners or hobbyists there are many languages which are just as good, if not better for their purposes. C#, Python, or any number of BASIC variants are just better for quicker, less-painfull development. Honestly, I'd bet most of the people here over 20 or so cut their teeth on some form of BASIC back in their teen/pre-teen years. I know I did; Apple IIe BASIC at first then onto QuickBASIC 4.5 and the DirectQB library.

Honestly, you can learn a lot more about game programming, heck, programming itself, when the eccentricities and weak-points of the langauge aren't in the way so much as they tend to be in C++. Of course, ALL languages have something "wrong" with them in someone's oppinion, but I don't think there's many people that would recomend C++ to a novice with a straight face. In fact, I think the only arguements that can be made in favor of C++ to a novice are "You'll probably end up learning it anyways, may as well start there." or "Everyone else uses it." or "Its the industry standard." which only truly apply to the 10 percent of people who would like to become professional game developers.

Its sad that there aren't more more resources out there in these easier langauges, It would be nice to have a series of articles written with a newb-friendly psuedo-code and supliments in some of these languages, say, Python, C#, VB.net, and even C++ (managed?) for those that dare.
throw table_exception("(? ???)? ? ???");
Sneftel
Sneftel
I think that when people are first getting into game development, there's this tendency for them to want to be "hardcore". They don't want to program in some user-friendly high-level language which people talk about with words like "workflow" and "unit testing" and "process model". No, they want whatever language they hear is being used in the industry. Oh, and then they hear that C++ is "faster" than C#. "Well, gosh, I guess I'd better use C++, then! I don't want my game to be slow!" The sad thing is, a lot of people encouraging others to learn C++ have never extensively used other languages, so while their opinion is useless they influence another wave of n00bs into thinking that C++ is the One True Language.
Thevenin
Thevenin
I don't know about C++, but I was hooked on C until the release of C# 2.0. I've now been using C# for all my projects including a rewrite of my MMORPG Fleurin.

Because I'm finding C# so easy and safe to use, I built up the courage to give managed DirectX9.0 a go (To be honest, DIBs in C# would have ran at around 5% of the performance my C code does, so I had no choice but to change my graphics API), not only did I find it EASIER than DIBs (I didn't have to write pixel manipulation functions to draw bitmaps, or worry about the display size being a multiple of 2), but the overall result is that my C# port will run faster than my C code (No C# is not faster than C, but (C#+DirectX) vs (C+DIBs), results in C# winning.

My biggest motivation for using C# though is the safe coding, I'm just naturally prone to making errors while coding, and C# is the cure. :D

(Note: I'm actually being bribed to say what I've said above. We all know that nothing beats C.)
Roboguy
Roboguy
Quote:
Original post by PantherBoy
My view is that c++ is the most valuable to learn and the most powerful. Particularly if you plan to do any console game engine coding c/c++ are necessities.

I disagree. I don't view C++ as the most powerful. To me the term "more powerful" means that it provides more means of abstraction and/or means of combination. You may have a different definition, though. Although, I do agree that it is valuable to learn in some cases (it depends on what you're trying to do).
Kitt3n
Kitt3n
One of the things to learn is to use api's...

In my current (commercial) project, we are using at least 8 different api's for all kinds of stuff (from physics, sound & ai/pathfinding to movieplayback, 3d-model animation & and networking). Saves _months_ of work.

Much of the api's are 'cheap' (a few 1000 usd - again, for commercial use!)
ie for this amount, you wouldn't be able to make it yourself.

Anyway, I think the "don't reinvent the wheel" also goes for amateur development.

Also take the right tool for the job - if you are making a gui/editor,
or something with databases then delphi/c-builder or c# will very likely
be more suitable then c++ (actually imo anything is better than mfc)

Regards
visit my website at www.kalmiya.com
Michalson
Michalson
Yes.

If you are going to be a good programmer (i.e. get a degree or similar), then language won't matter - you'll have the skills and the theory to learn whatever language/API you need to use (either what is best for the job, or what the employer wants) in short order. Often languages are designed to be similar to each other anyway - as I already knew C++ and Delphi, I literally picked up C# in an afternoon and rewrote an application in a single day that originally took me a week in Delphi (and would have taken even longer in C++ as it was a graphical GUI centric application).

What I see as more important to an amateur/hobby game programmer is being able to use something that lets you get the most done with the least hassle - you should be concentrating on getting your game juices transformed into something playable on the screen, not wasting time on the language itself.
DuFaceTheBass
DuFaceTheBass
I'm a C++ programming through and through, but:

Quote:
Original post by PantherBoy
...
C# is very good if you defiantly want to stick to a windows platform but a component written in c++ is most easily usable in other platforms\languages if designed correctly. I use c# quite a lot for tools work were speed is not as critical.

The .NET runtime is not limited to a Windows platform, if anything it's probably easier to make cross platform code in C# than it is in C++. Also this whole speed issue is a bit redundant. I seriously doubt many of us write code that load the CPU up that much, and the speed difference between the two languages is probably negligible except in extreme cases.


I feel bad talking against C++ when its the only language I feel comfortable with :(
"I just wanted to hang a picture on my wall, but somehow now I'm in the Amazon Jungle looking for raw materials." - Jekler
Vincent Wolf
Vincent Wolf
Programming languages are just tools we use to build games. I think that everyone should learn and use more than one language. A good mechanic can't do all the work with just one screwdriver.
SAL1
SAL1
When I first started learning C++, my goal was to make games, the first question any total newbie asks is "How do I make a game?", the second question is "What programming language was used to create game X?", and since X is usually an AAA commercial title, the answer until this moment is almost always "C++".
That newbie now have one goal infront of him, that is to learn everything about C++, while ignoring all other programming languages.
After a few years, when he looks at one of these languages that he ignored, well, he usually wishes to go back in time and use that language instead of C++, that would have saved him a lot of precious days, months, and sometimes years that he had lost debugging and taking care of things he should not bother himself with.

That's how things happened for me, and I'm sure the same thing happened to a lot of game developers other than myself.
And that's my opinion.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.