• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
trapeze

learn C or C++ ??

44 posts in this topic

Quote:

Python? Are you serious? Are we not discussing programming languages? Python is a scripting language AFAIK.


Care to tell us the difference? If you mean that it's suited for creating small scripts that run embedded in a larger C++ app, then no. In fact, if you go for embedding you better choose a more lightweight tool, like Lua. Python is a very high-level full-fledged programming language with a very rich standard library and many quality 3rd-party libraries that is best suited for writing the entire application in it, and maybe extend the critical modules in C++ if you're hungry for performance. So, why the "industry"(with exceptions like EVE Online,Civ4 and so forth) doesn't do it in a greater extent? Who cares. We don't, and a beginner certainly doesn't. The industry has a million reasons to do things the way it does, and none of it affects us hobbyists and indies.

Anyway trapeze, since you're just starting your goal is to learn to think like a programmer. So for a first language pick something that makes your life easier and helps you focus on the important concepts instead of technical details. Python and C# are such languages. I suggest you pick one of them. Of course, you will eventually also learn C,C++, and hopefully a bunch of other languages, but for a beginner, C or C++ are not really advisable.

[Edited by - mikeman on September 15, 2007 7:41:47 PM]
0

Share this post


Link to post
Share on other sites
http://en.wikipedia.org/wiki/Scripting_language

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++.

Furthermore, it is often referred to as a OO Scripting Language.

I admit that I didn't know enough about Python, and referred to it from the knowledge I had.
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.

No matter what, I still recommend the guy to learn C++ - especially if he wants to work in the industry. After having learned C++, everything else will be easy.
0

Share this post


Link to post
Share on other sites
Quote:

http://en.wikipedia.org/wiki/Scripting_language


So, "scripting" means "interpreted", instead of "compiled". It has nothing to do with what the language can actually do. Pretty pointless distinction if you ask me.

Quote:

And since it is interpreted, it is far from as fast as a binary program, like those created by C++.


So? The OP wants to know which language is best to learn programming with. What "speed" has to do with that? What kind of a program will a beginner make that would require performance not provided by Python?
0

Share this post


Link to post
Share on other sites
I edited my above post after you replied, sorry.

Quote:
Original post by Mercenarey
I admit that I didn't know enough about Python, and referred to it from the knowledge I had.
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.

No matter what, I still recommend the guy to learn C++ - especially if he wants to work in the industry. After having learned C++, everything else will be easy.


He stated clearly that he wanted to work in the industry. And he named areas like networking. I couldn't imagine doing that in an interpreted language exclusively.
0

Share this post


Link to post
Share on other sites
Quote:
Original post by Wikipedia
http://en.wikipedia.org/wiki/Scripting_language

Scripting languages (commonly called scripting programming languages or script languages) are computer programming languages that are typically interpreted and can be typed directly from a keyboard. Thus, scripts are often distinguished from programs, because programs are converted permanently into binary executable files


Notice the last line:
"Thus, scripts are often distinguished from programs, because programs are converted permanently into binary executable files."

Im not saying that Python should be classified as a scripting language exclusively on this description. However, you can't blame me for my assumption.
0

Share this post


Link to post
Share on other sites
Quote:
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 program written in pure x86 assembly should be faster(in theory) then a C++ program, why don't you program in assembly?

Quote:
Original post by Mercenarey
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.


You make it sound like he'll get 2 frames per second. It's slower, not slow. I think if you actually took the time to learn Python, Mercenarey, that you'd find it is a lot easier to make programs with then C++ and is fast enough for most people. Anyone working by themselves isn't going to be making anything close to commercial quality anyway.

Quote:
Original post by Mercenarey
No matter what, I still recommend the guy to learn C++ - especially if he wants to work in the industry.


Our point is that he doesn't have to learn it first. He can deal with basic computer science concepts first and struggle with syntax later.

0

Share this post


Link to post
Share on other sites
Quote:

He stated clearly that he wanted to work in the industry. And he named areas like networking. I couldn't imagine doing that in an interpreted language exclusively.


Twisted

You need to let go of your prejudice and misconceptions about "interpreted languages". All they are is bytecode that is executed by a virtual machine instead of the actual machine. That's all. "Scripting" is an issue of definition that, in the end, is pointless. There's no actual difference. Python is a programming language, period. If anything, the fact that it doesn't need compilation is a pro for a beginner. There's nothing C++ can do than Python can't(the opposite is true in some cases, I can show you examples that take 8-10 lines of Python instead of thousands of lines in C++).
0

Share this post


Link to post
Share on other sites
Ok, it seems I wandered into a camp of Python zealots.

I can't see what this has to do with my initial recommendation. And I can't see that my recommendation is worse than yours.
0

Share this post


Link to post
Share on other sites
Quote:
Original post by Mercenarey
I can't see what this has to do with my initial recommendation. And I can't see that my recommendation is worse than yours.


Your initial recommendation is this:

Quote:

If your choice stands between C and C++, there is no doubt that you have to choose C++.


And I agree with it. However, if the choise is not limited between C and C++, I feel Python or C# are far better choises for a beginner. I'm far from a zealot, I've just worked with all those languages and can compare(Have you?). However, your recommendation is not 'worse'. It's not a race. We're just exchanging opinions here. You have the right to have yours, although you have failed to provide any real argument here: you just classify Python (which you admit that you don't know yourself) under the vague term 'scripting language' without explaining why that matters at all).
0

Share this post


Link to post
Share on other sites
It feels like a race, because I have had to defend against everyone here, and I even recieved minus points in the process.

You are advising a guy, who wishes to work in the industry and who wishes to do networking to use an interpreted language.

I will stick with C++. Lets just agree to disagree then.
0

Share this post


Link to post
Share on other sites
Hello,

First off, I can't believe the discussion got this heated, but I knew it was the moment the poster posted this topic. The two languages were C# and Python. Everyone fight about which language he should learn first, but I noticed that two languages get mention very quickly. 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 to the poster of this topic I say you should sit back and look at your skills. If you always challenged yourself in life than I can say as an opinion you can go to learn C++, but be advise it is hard to grasp some topics.(That is why I learned C++ first, but I know I am no were near a master. Hell I wouldn't even consider I am in the intermediate section either.) For example, pointers, abstract classes, derived classes(in a way), and some other topics. I do not know if C# or any other language have those topics since I only learned C++ and Visual Basic so far, but it can get hard at times in those topics.

I would actually advise you to just learn any language you want and just come here for help if you need it. That is what this community is for. Anyways you can always heed the advice that was given numerous times to you before, which was learn either C# or python (This IS a programming language, and not just a scripting language. I know a previous poster said that it was not a programming language, but it is. There is actually an article on GameDev.net website about someone who choose to try to make a game in a week and he used python for it.) as a beginner language.

Well I wish you much luck in your journey and if you EVER need help just come here and ask your questions, because there is people in this community who cares to answer them.

~Carl J. Loucius
0

Share this post


Link to post
Share on other sites
Quote:

You are advising a guy, who wishes to work in the industry and who wishes to do networking to use an interpreted language.


Yes, I am. I really don't see why not.
0

Share this post


Link to post
Share on other sites
Quote:
Original post by Mercenarey
Ok, it seems I wandered into a camp of Python zealots.


No you've wandered into a forum where high level code is generally preferred to unnecessarily difficult languages like C and C++. The vast majority of beginners come to this forum with limited programming experiance and wanting to make a game. In general this forum tends to recommend using higher level languages that make learning to program easier so that the beginner can focus on learning the ins and outs of programming and writing games rather than irritating syntax and undefined behavior issues related to C++.

In particular this means that the forum tends to recommend python with pygame and C# with XNA. Both of these languages are much easier to write correct code in than C or C++ and in general will lead to a beginner being more sucessful at writing their game.

Quote:
Original post by Mercenarey
I can't see what this has to do with my initial recommendation. And I can't see that my recommendation is worse than yours.

Your initial recommendation of C++ is flawed for several reasons.


  1. C++ and C have largely undefined behavior in cases where code is incorrect. This makes it very difficult for a beginner to learn by experimentation. Reading outside an allocation or returning a pointer to a local variable are both incorrect, but tend to work "correctly" until they don't This means that a lot of beginners write code they think is correct and only starts breaking after they've written thousands of lines.

  2. You emphasize speed as an important reason to choose C++. Ignoring the fact that C++ is not necessarily faster than managed solutions (and is sometimes slower) this implies that beginners need to and are capable of writing high performance code. In general this isn't the case. Unless you make significant algorithmatic mistakes asteroids is going to run just fine on a modern computer regardless of whether it's being interpreted, compiled or anything else.



0

Share this post


Link to post
Share on other sites
You honestly believe a network programmer who only knows Python will get a job in the industry?

IMO only gameplay programmers at the highest level would get away with only knowing python.

Last words from me, cya around.
0

Share this post


Link to post
Share on other sites
Quote:
Original post by Mercenarey
You honestly believe a network programmer who only knows Python will get a job in the industry?


*Sigh*

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.
0

Share this post


Link to post
Share on other sites
OP:

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.

Cheers!
0

Share this post


Link to post
Share on other sites
Quote:
Original post by Mercenarey
http://en.wikipedia.org/wiki/Scripting_language

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.

Quote:
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).
0

Share this post


Link to post
Share on other sites
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.
0

Share this post


Link to post
Share on other sites
Quote:
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:
Quote:

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)
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0