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

why is C++ still being over-used?

Started by graveyard filla Oct 3, 2008 at 4:50 PM 257 replies 81.7k views
Original Post
graveyard filla
graveyard filla
Just a bit of a rant here... I've been out of the GD thing for a few years now, and (once again) getting the itch to get back into it. So I'm working on porting over (actually completely re building but that just makes me feel better that i didnt waste my time) my old C++ 2D MMO engine to XNA / .NET... One thing I still see rampant on these boards, is that everyone is still (over) using C++. I really don't see how C++ is at all the right language to use to do any kind of indy / amateur game development... and yet, I still see everyone on these forums using them. Newbie game programming asking low level C++ questions.... etc, etc.. and hardly ever do I see the answer being 'stop using C++!'... Why are we still using it so much? Why are we not reiterating the advantages of using higher level languages to these young and ambitious game dev newbies? For the years I have been here I can say we are probably the smartest group of developers I have ever seen on any community... we beat into newbies brains the fundamental programming concepts. Don't optimize first, use a profiler. Don't make an MMO first, make pong... etc etc (yes i know not the best examples but you get what i mean)... so why am I not seeing people beat into newbies brains they should be using .NET or some other higher level platform to do game development??? Think of how much more could be getting accomplished, how much more people will learn a bout (practical) concepts.... how many new API's we might have or even cool new games we could be playing... There's only one reason I can say to someone to use C++ for a game... that would be that your main goal in life is to become a professional game developer or otherwise professional C++ programmer. If that's not the case, stop wasting your time and start using the right tools for the job!!!!! It's 2008 guys!!! sorry [grin]
FTA, my 2D futuristic action MMORPG
DevFred
DevFred
Quote:
Original post by graveyard filla
and hardly ever do I see the answer being 'stop using C++!'...

Really? I see these kinds of posts quite often.
chapinch
chapinch
I think initially people use the language they are most comfortable with which tends to be c++ as this is one of the most widely used in programming, and develope from there.

I have been learning c++ for a year and would like to make some small games what advise would you give to me?
KulSeran
KulSeran
Well I think your last point hit the nail on the head. The implied or otherwise intent of many of the posters is "I wanna make games for a living". There are sections of the industry that have moved on to other languages. But many times company base code is all C code, not even C++. And for one bad reason or another, they won't upgrade any of their code/design methodologies from C. But one good reason they all stay in C/Asm is that you are given what you are given for console development, and that usually means a C compiler, or if you are lucky a working C++ compiler.
knivil
knivil
Quote:
your main goal in life is to become a professional game developer or otherwise professional C++ programmer

That was my dream and reason to start programming. C++ is easy to learn and hard to master. And if it takes 5 years of practice to reach moderate level, start early. And after that time you realize that C++ is the greatest language out there. Ok not for all problems. If i need a VM, then i take Java (script -> lua, planning -> prolog, ...).

janta
janta
Do you only know what you've just started here? ;) Let me get some popcorn.
Promit
Promit
I tend to think that there's a substantial subset of members here who are interested in going into professional development, for which C++ experience is an necessary prequisite.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
Neptune
Neptune
I think many people believe so-called high level development environments are slower(overhead) and do not provide direct access that C++ provides. How would you respond to those people?
Drew_Benton
Drew_Benton
Quote:
Original post by graveyard filla
There's only one reason I can say to someone to use C++ for a game... that would be that your main goal in life is to become a professional game developer or otherwise professional C++ programmer. If that's not the case, stop wasting your time and start using the right tools for the job!!!!! It's 2008 guys!!!


Sorry bud, but you just invalidated your entire post right there [headshake] You were really on a roll too [wink] Let me explain.

How many people start indy/amateur dev for the sole sake to make money? Not many. Now that question is ambiguous so let me further clarify. If you know you have to make $400 by the end of the month to pay bills, would you undertake game programming to fulfill that task? Absolutely not. (Assuming you have never done it before and are not employed, etc..) You would find some decent paying job to get by on so you can pay your bills and make a little over to have for your hobbies. That is not to say people don't make games with the intent to sell them, but the people who are just starting obviously have some time on their hands to learn and explore the field.

Now, that is important to consider because, if you look at why people even get into game programming, it would naturally be (in my eyes): 1) to pursue a career in it (and thus become a professional) 2) write their own version of 3) and in a few rare cases, they have a mindset that all the cool people do it.

All 3 points above point to a recurring theme of "if I want to make what I see, I have to do and learn what the professionals do". It is just common sense in a way, if you see your favorite sports star practice running backwards on a track for 2 hours a day and you want to be like them, well you would run backwards on a track for 2 hours a day. To anyone who would dismiss that though, one word for you, endorsements, just consider that.

Now, right now, it is almost the de facto standard to use some C/C++ in your game project in the industry. You look at all the game engines around, they are mostly made in C/C++. That is the current trend right now. So, when you tell someone new that they shouldn't use C/C++, it's , , , it would appear to them that you are telling them that they don't have the capability to be able to do what they want, which as we all know in human nature, just drives us more so to do it (attraction/repulsion).

Top that off with all of the horrible misinformation on the web about everything, you have a horrible environment for beginners that don't know better. I'm talking about things like, "Visual Basic is an easy language, but too slow", "Java is too slow and no one really uses it", "C++ is the most powerful language", ad infinitum. The problem is that of context, something that is hardly paid attention to when people make such blanket statements. This is better known as: "know the power of the tools available before you use it for a job". Sure you can construct a giant DeathStar in space that can send a laser down to kill a single ant, but why do that when you can just step on it? Such logic is not what is written about, only how to construct the DeathStar or How to put a shoe on your foot.

Overall, I think there's not enough influential or even accurate resources available for people to make the best decisions for their selves, in which even that in itself is a circular dependency since they are incapable of knowing what is the best for their self. However, by not using C/C++, you will not be able to learn practical game programming concepts any faster than if you used C# or any other language.

The reason is, there is no game programming specific language. You still have to learn the language. How "easy" it is it highly subjective - OOP languages force one specific perspective on development, and that perspective is not the only perspective in that. It's actually quite dangerous for people to be forced into one specific perspective such as that. So, the problem you are alluding to is that of learning the tool you choose to develop in, not how practical a language is for game development. That distinction is important to make because it goes back to what I said earlier about a lack of resources being available to make the better choice for the person to get started.

And to think, all this discussion is just on the actual language used for a game. A game is more than a program, much much more, and until we start enforcing the idea that you just don't "program a game", we will be in this cycle for a long time. That might be the most important aspects to this topic, since all I am seeing is "How to program a game using this specific API" and not "How to engineer a game". But that's a another post for a rainy day, to which I've already brought up.

Just my $700 billion worth of cents [rolleyes]
DevFred
DevFred
Quote:
Original post by knivil
And after that time you realize that C++ is the greatest language out there.

May I ask what other programming languages besides C++ you are accustomed with?
Sirisian
Sirisian
On IRC we tend toward having beginners learn Python or C#. It teache peoples the basics of programming. One thing many beginners don't fully realize is that basic programming concepts are common between languages. For instance, I can go from C++ to C# to AS3 and use the basic concepts to create the same algorithms with mere syntactic differences.

A member of gamedev took the time to discuss and write this article:
Picking a Language
It helps beginners to start on their path of programming. Not to mention it covers the C++ question which is asked a lot.
Promit
Promit
Quote:
Original post by Neptune
I think many people believe so-called high level development environments are slower(overhead) and do not provide direct access that C++ provides. How would you respond to those people?
Well, I'd start by asking them some basic system level questions, which nine times out of ten would reveal that they do not, in fact, know jack shit about how C++ works or how it interacts with their operating system. (This is a very good bet, because anyone who thinks C++ provides "direct access" is living in a world divorced from reality.) For the one out of ten who do understand that stuff, I ask some questions to check whether or not they have any idea how higher level languages (such as, but not limited to C#) work. That knocks out nine of ten again.

For the remaining one out of a hundred, well, it depends, but by this time they've probably earned a rate down and a cold shoulder.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
PKLoki
PKLoki
Game dev is largely language agnostic in the sense that whether you implement your algorithm (be it A*, OBB calc, scene graph stuff...) in C++, C#, or whatever language, you learn the algorithm and data scructures independently from the language. As my boss says, all these languages are Turing complete, so anything you can write in one of them you can write in another. I think he's probably right (though he's smarter than me!) I guess in the same way you could explain all of these concepts in French and English (at least ToohrVyk can!) but the concepts remain the same. The only difference is that with XNA (for example) you're given a large class library and framework to get you started. (Don't get me wrong, I'm a fan of XNA, I use it myself in projects with friends and I think it's a good framework.)

I'd like to add, from my own experience, that C++ is used in a lot of the more 'interesting' areas of coding. Sure you can work for a bank or insurance company and spend all day writing database/web code with C#/ASP.NET but personally I'm not too excited by that. I work as a software engineer/researcher in medical image analysis, and we use C++ exclusively, as does everyone in the field that I'm aware of.

C++ has the advantage of cross-platform functionality too, which is a big bonus in scientific applications where your clients present a mix of unix and windows systems to deal with. Many of our clients simply wouldn't be interested in .NET apps because it doesn't fit in with their existing IT infrastructure.
dave
dave
Quote:
Original post by PKLoki
C++ has the advantage of cross-platform functionality too, which is a big bonus in scientific applications where your clients present a mix of unix and windows systems to deal with. Many of our clients simply wouldn't be interested in .NET apps because it doesn't fit in with their existing IT infrastructure.


Java no good?

loufoque
loufoque
C++ is both a low-level and a high-level language.
It can be much more high-level than most other languages out there, including Java/C# and ML/Haskell, if you use the right features.
Also, at the same time, you always have an idea of the kind of code you're generating and what you're doing, and you will mostly always be able to write code as efficient as you want it to be, without huge language constraints.
Moreover, it's one of the only languages that does resource management right.

It is also an accessible language and has fairly good implementations on a large number of platforms.
knivil
knivil
Quote:
Original post by DevFred
Quote:
Original post by knivil
And after that time you realize that C++ is the greatest language out there.

May I ask what other programming languages besides C++ you are accustomed with?

It is just an opinion. I can't justify my statement with rich experience in many programming languages (worked with C++, Java, Prolog, Lisp, Lua and Perl). But look at C#, not every problem is an object and D has garbage collection.

VillageIdiot
VillageIdiot
You seem to really not like C++. My reasons for doing C++ are:
1. I am already a web software developer and want to migrate to computer development. C++ programming jobs are plentiful and well paying (although .net makes a decent paycheck also).
2. I like C++ more than C# or VB, I know all three fairly well.
3. I love the challenge.

If learning curve is the only priority to telling people what to use, why stop at C#? Most (not all, but most) home developed games, especially that of a beginner, would be fine suited by visual basic or something like that. Why not send them down that road?

I guess it is all about what you are in it for. If I had no interest in professional software development I would probably use a basic language. I just don't see why you would send a newbie to C# for ease of use opposed to a basic language.

My point is that C++ really isn't over-used any more than C# or basic. Reason for that is that it cant be over used, it is all a matter of preference.
I would rather you disagree with me then accept everything I say. Think for yourself!
MaulingMonkey
MaulingMonkey
Quote:
Original post by loufoque
It can be much more high-level than most other languages out there, including Java/C# and ML/Haskell, if you use the right features.

Gotta disagree there. No lambda functions, no garbage collector, no reflection, extremely limited type inference (e.g. templated function arguments), no intentionally introduced metaprogramming facilities (template and macro metaprogramming are more happy accidents [sic] than anything else), what else am I forgetting...

Seriously though, give some examples of how you feel C++ can be "more high-level" than, say, C#.

I disagree with basically the rest of your post too, but this seems like the point most likely to be at all interesting.

Quote:
It is also an accessible language

We agree if you mean that tools are easy to get for C++, but we disagree if you mean to say that the language is easily picked up on. Because it's not.

Quote:
Original post by graveyard filla
and hardly ever do I see the answer being 'stop using C++!'...

Sorry, I got kind of bored of repeating myself over and over again.
lol
lol
I myself am still a n00b, and I use only c++, even though I know a couple of higher level languages like Java. The only problems I run into are math/linear algebra related problems (like not understanding CSG, BSP, quaternions, OBB, etc). I very rarely have any c++ specific problems (like memory corruption) that would be fixed by using a different language.


Also, I have tried using Java for games in the past. For me, it has been a very frustrating language due to too many rules (such as the requirement that every single last exception be handled, even if you are 100% sure that the exception will never be thrown under the given circumstances).
Placeholder for better sig.
xZekex
xZekex
C++ is still used just as much as C is used. Believe it or not. People still prefer programming in C++ over C# or Python.

Topic Locked

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

Sign in to reply to this topic.