Jump to content

View more

Image of the Day

The night is still, but the invasion brings chaos. #screenshotsaturday #hanako #indiegame #gameart #ue4 #samurai https://t.co/cgILXuokoS
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

Sign up now

learn C or C++ ??

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
44 replies to this topic

#41 mikeman   Members   


Posted 15 September 2007 - 02:34 PM

Original post by Mercenarey
You honestly believe a network programmer who only knows Python will get a job in the industry?


I said he should start his programming endeavors with a language like Python. Not end them there. Of course he must learn C++ if he wants to maximize his odds of finding a job. And probably a bunch of other languages too. But first of all and most of all, he must learn programming. And I think Python makes that easier. That is all.

#42 JWalsh   Moderators   


Posted 15 September 2007 - 05:59 PM


C vs. C++
To answer your original question, if you're torn between learning C or C++ first, the answer is most definitely C++. C++ is the standard language currently used in the game industry, and has an object oriented paradigm more suitable for representing game entities and systems than ANSI C.

Regarding Python
To respond to the somewhat heated debate, Python is a perfectly fine language (scripting or otherwise) for learning to program. And with the help of Pygame, actually DOES allow you to implement fully functional games. Although it is strictly speaking "slower" than compiled C++, I've seen bad programmers develop poorly implemented C++ code which does, in fact, run slower than Python.

Speed as a reason for NOT using scripting langauges
While it is largely intuitive, more formal programming paradigms such as "eXtreme Programming" have made clear the concept of "Optimize Last", which simply means that optimization is the last thing you should be focused on when developing...well...anything. So as a beginning game programmer, the execution speed of the game is more or less irrelevant.

C# and Video Games
C# has a syntax more like C/C++, is also extremely powerful, and provides access to XNA - a set of libraries and a build system designed to make developing games easier for beginners and hobbyists. As well, being a .NET language, C# has access to the .NET Framework Library which means far less must be implemented by the developer, leaving more to the good folks at Microsoft or Mono to implemented for you.

Introducing IronPython
And speaking of .NET, you might want to check out IronPython. IronPython is an extremely fast implementation of Python, written entirely in C# (well, mostly), and giving Python access to the .NET Framework Library, allowing people to develop entire WinForms applications in Python. BOOM!

Java and Video Games
Next, Java does have OpenGL bindings, but does not have DirectX bindings that I'm aware of. This means if you want to use the full DirectX 9c or DirectX 10 interface - you're stuck with C++. Promit and others here on GDNet are working on SlimDX, which is a managed wrapper giving access to DirectX 9c and DirectX 10 via Managed languages such as C#, C++/CLI, VB.NET, and...wait for it...Python. I'm not sure what percentage of coverage they now have, however, which is why I didn't mention it earlier.

People's inability to use the search feature
Finally, yes, this question has been asked and answered 100,000,000,000 other times here on GDNet. (Seriously, I counted). Before asking this question again, please do a SEARCH for C++ vs. C or somesuch here on GDNet. You're bound to get good answers, without ever having to ask a question. As well, this needs to be updated in the Forum FAQ. (Not that anyone reads it anymore).

Alas, I'm now ranting. Please bring this thread back to a civil level of discussion or I will close the thread.

Jeromy Walsh
Sr. Tools & Engine Programmer | Software Engineer
Microsoft Windows Phone Team
Chronicles of Elyria (An In-development MMORPG)
GameDevelopedia.com - Blog & Tutorials
GDNet Mentoring: XNA Workshop | C# Workshop | C++ Workshop
"The question is not how far, the question is do you possess the constitution, the depth of faith, to go as far as is needed?" - Il Duche, Boondock Saints

#43 MaulingMonkey   Members   


Posted 15 September 2007 - 06:08 PM

Original post by Mercenarey

I have only seen Python being used as a scripting language. And since it is interpreted, it is far from as fast as a binary program, like those created by C++.

A quick check in the IRC channel confirms my vauge recollection of the matter -- python generates .pyc (compiled python scripts, which I certainly don't think qualify as "interpreted" when run) by default when you import a module. You can choose to just distribute these files and not provide the original "interpreted" scripts to the end user if you want. EVE Online did this for some of it's code IIRC.

However, no matter if you can develop all with Python or not, you must admit that it is best utilized as a scripting language, since it is interpreted, and thus slow. Games are known to be power hungry.

1) It's not (always) interpreted, and thus is fast ;-).

2) Performance only matters where it actually matters -- the bottlenecks of your program. Given that EVE Online used stackless python to program their mission agents (for example), because C++'s threads were too heavyweight (thus slow) for the task, it just goes to show that if you're writing python entirely off for "performance reasons" you're doing it wrong. To write it off anywhere else requires profiler results telling you that you actually have a performance reason.

3) AAA games are known to be power hungry. AAA games are also known to require massive team sizes reaching up into the 100s, of professional programmers that do this kind of thing as a full time job -- and they're still known to use "scripting languages" extensively.

In just about every field too.
FPSes? Heard of Unreal? Heard of Unreal Script? Epic certainly doesn't seem to shun "scripting languages".
MMORPGs? Heard of WoW? They use Lua in their GUI.
The already mentioned EvE Online is mostly Python.
RTSes? Heard of Civilization 4? Also mostly python.

And this has even been ignoring the fact that you will not be making AAA games while you're working mostly on your own, and thus probably won't need to squeeze blood from the stone of performance. Instead, you will be focusing on learning the technologies involved, and how to complete projects using those technologies.

Including scripting languages. So why not start there? After having learned a sane language, learning C++ will be much easier. And with all the time saved by not writing and debugging every little thing that never should've been C++ in the first place (given that it's one of the most ill defined languages (in terms of behavior) of all times), you'll end up learning to use C++ effectively (what professionals looking to hire you want) in a much shorter timeframe (compared to blithely coding in C++ for no apparent reason, which is almost certainly the exact opposite of what they want).

#44 Oluseyi   Members   


Posted 15 September 2007 - 06:20 PM

You know, it really doesn't matter which language you pick first. If you're ever going to be a good programmer, it won't be your last.

Flip a coin. Pick one. Get to learning.

#45 Promit   Senior Moderators   


Posted 15 September 2007 - 06:30 PM

Original post by acddklr07
I swear a mod. or an admin should just make a sticky about not posting this stuff and should redirect them to older topics before they do.
Well, I drop this every so often:

This one enjoys fairly significant popularity. (Note that only threads containing significant discussion are included.)

1) Professional Games Made In C#?
2) Java for game development?
3) Java----C/C++
4) c++ or c#
5) Question about Java Vs. C# Vs. C++
6) Java Games?
7) Java is fast?
8) Secondary Language:VB or Java?
9) What makes C++ so powerful?
10) C# games and cheating...
11) Is C# good enough for system utility programming
12) MC++ vs. C#
13) Which language is best for a 3d Games Engine?
14) C# vs C++ as a choice for development
15) Is Java the Future?
16) why C# and not Java?
17) What do you think of the D language?
18) my c++ d c# benchmark!
19) The Definitive Guide to Language Selection
20) Sharp Java
21) C++ or C#?
22) C++ or C#?
23) Java disadvantages
24) C++ or C#?
25) Visual C++.net vs Visual C#.net
26) C# - huh?
27) which language should i learn?
28) C or C++ or C#
29) learn C or C++ ??

This particular list is my top ten, because of the sheer frequency with which they occur. 12 days, 10 threads.
1) c++ or c# (5/1/06)
2) Java for game development? (5/2/06)
3) Java Games? (5/3/06)
4) Java----C/C++ (5/3/06)
5) MC++ vs. C# (5/4/06)
6) What makes C++ so powerful? (5/9/06)
7) C# games and cheating... (5/9/06)
8) Is C# good enough for system utility programming (5/9/06)
9) Which language is best for a 3d Games Engine? (5/11/06)
10) C# vs C++ as a choice for development (5/12/06)

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.