Page 1 of 1
Why C++?
Posted: Tue Mar 10, 2009 11:24 pm
by hayk0510
Hey everyone,
I was wondering why everyone uses C++ for game development?
I realize that it is the industry standard, but what difference does it have when compared to other languages such as Python, or C#?
According to some research, I don't think the speed issue should be a problem for a "hobbyist game developer". The reason companies still use C++ is because they do not wish to waste the time/resources redoing massive amounts of code in "X" Language. (Correct me if I'm wrong.) Other than the usual Microsoft bashing and such, how does a language like C# or Python really compare to C++ for game development(and applications as well)? Is the rapid development time worth the speed hit for the hobbyist programmer?
My real question is, are there any severe limitations from using a scripting or high level language(C#, Python...) vs using C++, just because it's the "industry standard"?
PS. I am going to pursue a degree in Computer Engineering next year(If that makes a difference in what to learn at all)
Re: Why C++?
Posted: Wed Mar 11, 2009 11:07 am
by Falco Girgis
Nice, I'm in my second and a half year of my computer engineering degree.
...and you're wrong. Speed and efficiency make all the difference in the world when it comes to modern games, and especially console games. What do you think let Resident Evil 4 look so damn good for the Gamecube? Why do you think that the Unreal engine cost so much money?
C++ is low level when compared to things like python and other scripting languages. There is no conceivable way that Elysian Shadows could be written (with the performance we want) in something like Python, Perl, or pure Lua. And there is definitely no way in hell that it would run on a 200mhz Dreamcast.
C# is decent, but it's certainly not standard, and it certainly can't outperform C++ as far as low level speed goes. Python and things like that have no chance in hell, as they are completely interpreted. C++ is not just used because it's the industry standard--it's also by far the best suited language for making games.
Re: Why C++?
Posted: Wed Mar 11, 2009 11:25 am
by avansc
well i dont know how you judge what the industry standard is.. i say this because i allways thought C/C++, but its al dependent on field.
here is a site for popularity
http://langpop.com/
but i noticed that even these are not representitive of the industry, for example, IBM uses REXX, which used to be IBM proprietary, and they use it alot. almost all the server labs use it as opposed to C++. and that basicaly most of IBM which i believe is still the biggest corporation (this was once true and i didnt research it now so dont get on my case if its not so any more)
as for your speed question.. yeah i agree that speed is less of an issue now, baring that you dont go be all 1999 and deve for dreamcast like ES team. (i originally just put falco, but im sure the rest of the team would have been like, that fucker doesent even do the bulk of the work or something snotty like that)
.
if you were just gonna do a small game and wanted something that baby sitted you more that C/C++ i would go java or C#. java has a huge community but i would say that C# is the better bet because of native support for al the little goodies like graphics and sound. dont get me wrong java has those to but not to the extent that C# has.
Re: Why C++?
Posted: Wed Mar 11, 2009 11:26 am
by Chaos Clown
There's also the issue with platform dependence. If you go for C#, you're bound to Windows/Xbox, so if you want to dev for other consoles, macs, or linux systems, then you're screwed. C++ should compile on pretty much anything, depending on which libraries you're using.
Re: Why C++?
Posted: Wed Mar 11, 2009 11:36 am
by avansc
Chaos Clown wrote:There's also the issue with platform dependence. If you go for C#, you're bound to Windows/Xbox, so if you want to dev for other consoles, macs, or linux systems, then you're screwed. C++ should compile on pretty much anything, depending on which libraries you're using.
ummm.. i believe that C# works on lin and others alike.
Re: Why C++?
Posted: Wed Mar 11, 2009 12:29 pm
by aamesxdavid
hayk0510 wrote:According to some research, I don't think the speed issue should be a problem for a "hobbyist game developer".
Is the rapid development time worth the speed hit for the hobbyist programmer?
If you're talking simply about the hobbyist/indie development, in most cases Python or C# would be fine for PC games (or XBox of course, using XNA). But the industry standard is the industry standard for a reason. Professional developers need to squeeze every little bit out of the processing power, and languages like C# and Python just aren't quite efficient enough to do that. A lot of development can be done in a lot of different languages, but because games are so processor-intensive, you need the fastest language. As far as being worth the time to develop in, most companies would rather spend more time making the game more efficient than producing worse games more frequently.. unless you're Activision. </burn>
Re: Why C++?
Posted: Wed Mar 11, 2009 1:01 pm
by wtetzner
avansc wrote:ummm.. i believe that C# works on lin and others alike.
Yeah, C# works on Mac, Linux, and Windows on the Mono platform (an open source implementation of the .NET framework). And (at least in theory) your compiled executable should run unmodified on those platforms without having to "port" them.
EDIT: Also, since we're talking about game development languages, I thought I would mention this:
http://www.franz.com/success/customer_a ... ydog.lhtml.
They used Lisp to write the Jak and Daxter games. I thought that was pretty cool. What's really cool about using Lisp (other than it's macro system) is that you can change a function, and recompile it while the program is running, updating in real time.
Re: Why C++?
Posted: Wed Mar 11, 2009 1:45 pm
by Chaos Clown
Whoops, shows how much I know, heh. Good thing I don't use C#, because if I did, it would be
really embarassing
. I could have sworn it was microsoft exclusive...
Re: Why C++?
Posted: Wed Mar 11, 2009 2:01 pm
by avansc
Chaos Clown wrote:Whoops, shows how much I know, heh. Good thing I don't use C#, because if I did, it would be
really embarassing
. I could have sworn it was microsoft exclusive...
nah dont worry about it.
i dont think its microsoft exclusive, and even if it was it be hard for them to make it windows only, that would make it a very unattractive programming language.
Re: Why C++?
Posted: Wed Mar 11, 2009 3:01 pm
by hayk0510
I see.
I was talking to a friend of mine who is in the software industry and he keeps urging me to learn C#. He says it's the latest and greatest and the future. (btw I live 5 minutes away from microsoft)
For me, creating games is a learning experience, I'm not looking at profit. So as far as the learning process goes(with a software/game job in mind) would it be smarter to invest my time in learning C++?
(might sound like a dumb question, but I want to have a solid programming foundation, and not develop any bad habbits along the way)
Re: Why C++?
Posted: Wed Mar 11, 2009 3:07 pm
by MarauderIIC
C++ is what you'd maintain everything in. There's a lot more old stuff out there than there is developing new stuff. Also, if C# is the wave of the future (every two years there's a new wave of the future), you'd probably need to port C++ stuff to C#.
And C++ -> C# is pretty easy. I know, I did it. Am doing it. Whatever.
I vote C++.
Re: Why C++?
Posted: Wed Mar 11, 2009 4:15 pm
by avansc
most legacy code is in C, VB and fortran and cobal.
Re: Why C++?
Posted: Wed Mar 11, 2009 7:17 pm
by hayk0510
Thanks for all the replies, you guys are a big help...
I'll give C++ a go, I've been programming in Python for a couple of months now I can seriously feel the limitations. It's easy but I do not feel like I am in full control. And a lot of game engines are made to work with C++ ( I think?)
Also, sort of off topic for this thread, but my bro would like to take a shot at game art. How do you get started there? Do artists just draw? Or is there programming or design required? (Sorry for randomness)
Re: Why C++?
Posted: Wed Mar 11, 2009 10:05 pm
by LuciDreamTheater
I congratulate your eagerness to get into C++, but just because it's standard in the industry, doesn't mean it's always used to learn how to program. Sure, many people take that route, but there are much easier languages to pick up than C++. Personally, I have no preference. I learned C++ first, but there are other options.
Re: Why C++?
Posted: Wed Mar 11, 2009 10:27 pm
by hayk0510
anothrguitarist wrote:I congratulate your eagerness to get into C++, but just because it's standard in the industry, doesn't mean it's always used to learn how to program. Sure, many people take that route, but there are much easier languages to pick up than C++. Personally, I have no preference. I learned C++ first, but there are other options.
True, but I have already learned the basics of Python. Now I want to get my hands dirty with a compiled type language. The thing is, I would much rather have a steeper learning curve now, than to have a bumpy learning process the whole way through. I feel that if I pick up C++ now, I will be able to pick up other languages fairly easy in the future(assuming that I become good with C++). Then again, a good programmer know many languages and how to use them well.
Although I have been warned many times to stay away from C++, it's either that or C (The only other books I have) Again this is for the educational experience, and I'm still doing quite a bit of research myself. But once I pick a language, I will stick to it.