Python questions

Started by
2 comments, last by daviangel 17 years ago
Ok i see a lot of people saying how excellent python is and what not and how easy it is to use. So my first question What makes it so easy to use? Why dont more people use if its so good? What major diffrences would make someone choose C++ over Python? Is python capable of making a game much like Illusions of Gaia? ( from the snes ) What sorts of things in python not make people want to use it as there dominant programming language. This is coming from a Game Programming point of view Feel free to add anything extra Thank you ~EPIQ
EPIQ Games, Coming Soon..
Advertisement
Quote:Original post by Epiq
What makes it so easy to use?

Dynamic typing, automatic memory management, extremely robust container classes, and a much more lax syntax, to name a few.

Quote:Why dont more people use if its so good?

Alot of people do, usually as a scripting language along with their game. Some companies (such as Humongous Entertainment) use it exclusively, and the newer versions of the SCUMM engine are written entirely in Python.

Quote:What major diffrences would make someone choose C++ over Python?

Speed. Python is an interpreted language, so there is a pretty big overhead when running a python app.

Quote:Is python capable of making a game much like Illusions of Gaia? ( from the snes )

Of course. Look up the library PyGame.

Quote:What sorts of things in python not make people want to use it as there dominant programming language.

Speed, and because most pre-existing code is already written in C++ (people like to re-use code). Plus, techies are already comfortable with C++.

Check out my new game Smash and Dash at:

http://www.smashanddashgame.com/

Quote:What makes it so easy to use?

A combination of a "batteries included" API and easy-to-read code. Things like forced indentation really help, in my opinion, and everything is always easy to use. Reflective code? one function call away. File IO? One function call away. Databases? Import the built-in module sqlite. I find it more useful than other programming languages in most of what I do, though there are always reasons not to use it, depending on the situation.

Quote:Why dont more people use if its so good?

I'd say that "old habits die hard". That aside, Google uses it, which is major in itself, as did Civilization IV on the game side of things. In fact, Python is the 7th most popular language according to TIOBE's TPCI.

Quote:What major diffrences would make someone choose C++ over Python?

Speed and flexibity are Python's field. When I say "speed", I mean speed of writing, not execution. C++ is useful for all things that need runtime speed, but Python is useful where you need to be able to change your code easily, run it across different platforms, or simply make a quick solution to a small problem. So when somebody chooses C++ over Python, they want it for something like a physics engine, or a major number-crunching program.

Quote:Is python capable of making a game much like Illusions of Gaia?

I see no reason why not.

Quote:What sorts of things in python not make people want to use it as there dominant programming language.

Some people simply don't like Python, and that's always the case for programming languages. Other people have no need for it, and all of their code is for speed of execution.
Having used it for the last couple of weeks and having read several different books on it the first things that come to my mind are:
simpler
faster able to code as fast as you think literally
fun
don't have to worry about casting your types to this or that since Python is usually smart enough to figure out what you are doing
string and pattern matching makes text processing a breeze unlike C/C++
support for advanced data structures not even available in C++ mean you don't need to worry about laying out memory,allocating and freeing space,etc
No arcane rules,exceptions to remeber and less typing than C++ to do same thing so your code is usually about 1/3 your C++ code.
It is used alot it's just that alot of people don't mention it or it could be like C++ programmers that still program in C++ they aren't aware of what's available?
Only thing I found lacking was Visual Studio and debugging support but I got IronPython working with VS2005 so that's kinda sorted out.
You'd choose C++ if you are doing alot of number crunching and need the utmost performance.
[size="2"]Don't talk about writing games, don't write design docs, don't spend your time on web boards. Sit in your house write 20 games when you complete them you will either want to do it the rest of your life or not * Andre Lamothe

This topic is closed to new replies.

Advertisement