Learning C++ or Python

Started by
13 comments, last by Jianju 12 years, 9 months ago
Hello all, first post here.

Ive had very little experience with PHP, Java, C++ and Python in the past and I know some of the basics, Ive done a Hello World program in all of these that worked too. tongue.gif
I am not sure whether I should pick up the 1000+ page C++ book that has been collecting dust in the bookshelf or should I dive into learning Python. I would like to write games as a hobby in my spare time. I would like to write small games and when I have some experience I would want to join an indie team and write something bigger and learn it further.

I know that Python is a lot easier to learn and would be good language to learn the basic game related algorithms with minimal effort and complications from language while C++ is a lot heavier and harder to learn.

I would like to hear your tougths on the matter. If you were a guy with the similar background as me and had a similar experience in the past, what did you choose and how did it work out?
[size="1"]C# .NET
Advertisement
Both.

As far as I know (I didn't wrote one line in Python so far) Python is a script language whereas C++ is a 'real' programming language.

I recommend you to take a look at Lua. It's (like Python) a script language and is very popular within the game programming industry.
When Lua is used together with C++, one can do some serious shit.

Visit my blog, follow me on twitter or check out my bitbucket repositories.

[font="arial, verdana, tahoma, sans-serif"]What is easier to bind together: C++ and Lua or C++ and Python?[/font]
[font="arial, verdana, tahoma, sans-serif"] [/font]
[font="arial, verdana, tahoma, sans-serif"]// [/font]Found this topic on the matter: http://www.gamedev.net/topic/375497-python-vs-lua-for-a-scripted-game-logic/
[size="1"]C# .NET
If you aim at writing small games on your spare time, I would recommend neither, It might be much better suited for you to go into XNA C# or Unity.

These two frameworks already provide the basics and allow you to dive right into GAME programming, learning c++ will require a lot of time for programming the basic engine before even thinking of game code.

Flash might also be a good option, specially backed up by some framework as flixels.

Game making is godlike

LinkedIn profile: http://ar.linkedin.com/pub/andres-ricardo-chamarra/2a/28a/272


I've done game programming in flash, python and C++.


Flash sucks. Don't do it.


It is slow, horrible syntax, and has way too much going on in the background.

As such, I'm very skeptical of anything that is higher level than python. Havn't tried Unity, but it sounds WAY too much like flash for my taste.



Python is easy to learn, and easy to write.

With PyGame, game development is very easy. But, python is big and slow (not quite as bad as flash), don't expect to do anything complicated.


C++ isn't a whole lot harder to learn. But programming in it is like trying to jog through waist deep water. However, it is very small, very fast, and their is lots of support for it. Once you finally get into it, you could theoreticly build industry quality games. (Not possible with anything higher level).



Currently I'm using C++, as I want to write large games, but Python is a very good place to start.
While there are attempts at making entire games out of python, its best fit is for scripting purposes, for that you'll need a strong c++ engine and game framework that uses the script, flash is very often integrated into c++ games to implement graphic interfaces, this is used in many AAA titles.

Flash is quite a bitch, I agree, but if you aim at small and simple games it is still a more direct approach than going full c++ without having a base engine.

Unity is nothing like flash, its more like game maker on steroids, its a fully game oriented edition tool heavily scripted with C#, free license, easy to learn and best of all, works on most conceivable platforms with little work other than designing your game to be playable on such platform.

Game making is godlike

LinkedIn profile: http://ar.linkedin.com/pub/andres-ricardo-chamarra/2a/28a/272


Anything but C++ should be fine.
I'm also making some games for fun. I started with C++ and have made several games, including one that I've been working on for almost two years. I haven't made any games in Python, but I do find it useful for automating other tasks involved in game development. For example, I wrote a script which takes in a description of a level and automatically generates the background image and collision data, which I can then put into my C++ game.

Python is really useful when you want to code stuff quickly and the task isn't performance intensive. I've heard there are ways to improve it, like Psyco or adding C modules, but I think these are way beyond the scope of a beginner. I haven't managed to do either of those successfully yet.
I trust exceptions about as far as I can throw them.
Use Panda3D free engine, and you can do both! Write the majority of your game logic in Python, but you can drop to C++ if performance becomes critical. As the engine composes most of the performant code, you should be able to do 99% of the work in Python.


As to interfacing Lua/Python with C++, both are fairly comprable. Its a relatively simple task, but can result in having to write a large amount of tedious "glue" code. You can use generators, but they tend to be problematic. That said, the glue code is horrifically easy to write, just as I said, tedious.
I would recommend against C++. It lacks way to much of newer language features and easy-to-use libraries (there are tons of libraries, but rarely as easy to use as in Python).

Python is very nice for small programs/games/apps but for larger projects it can it can easily become messy. That goes for most dynamic languages which is why they are usually used together with engines written in lower level languages, at least in gamedev. My engine is written in C# and features Python scripting through IronPython.

I would personally recommend C# though. Simple, powerful, great toolchains, great samples/libraries/documentations and quite popular.

This topic is closed to new replies.

Advertisement