Gripes with Python

22 Jan

When I started my rather large undertaking to try to complete 12 games in 12 months I took python as my language of choice. I had very little experience in it and wanted to becoming versed in the language and its intricacies by the end of the year.

For January I decided to write a small text-based adventure (specifications will be put up shortly) it seemed to be right up Pythons alley, lots of string manipulations, none to very little data storage and the code is almost script like rather than a complete program because no external modules are used. All my code is kept in a folder along with a python setup executable so that I can access the data and code / debug from anywhere on almost any computer. This setup was perfect for about 2 days when I started to run into various problems.

Gripe 1 – No proper IDE
Before everyone starts chewing off my head, I come from a C / C++ background with a Windows OS. I use Linux (Ubuntu or Fedora) and have love / hate relationship with it, I regularly use the command line for compiling and debugging and often switch between Visual Studio my IDE of choice and Notepad++ when coding. However Python has no proper IDE for Windows that can match Visual Studio for convenience and in my humble opinion quality, it just works and if I’m not mistaken that Python unofficial motto.

Gripe 2 – Whitespace or Tabs
Many people attribute this as a key component for improved productivity. For me however its been nothing but a headache. I’ve been forced to change my entire coding methodology as I can’t move from Visual Studio to Notepad++ with causing some sort of white space error. I spend more time trying to correct syntax errors than actual coding.

Gripe 3 – Lack of Braces
Using braces comes naturally to me because of use in C / C++. Python does not use any while this is not a major problem I find the syntax rather a little difficult to read as I find it difficult to find out where a condition ends particularly when it is multi-lined.

Gripe 4 – Multiple Versions
Python has far too many versions and to use any tool created I need to use a different version of Python or jump through hurdles to print “hello world”. While trying to program games I’m dabbling in the Google App Engine and it requires Python 2.5, I use IronPython in Visual Studio which is compatible with Python 2.7 and when I’m using Pygame or Panda 3D I need to use Python 3+. It is very annoying as each implementation has different syntax and modules are not cross-compatible with Python 2+ and Python 3+, with most not having finished conversion as yet.

Even though I have some genuine problems and irritation working with python I’m finding its community to be very helpful and patient with new users particularly those on r/python.

Code samples are readily available in Python, especially for those looking for large projects that include scaling and other popular buzzwords used today. There are some very interesting projects that are written in Python and following them, editing some of the source is interesting and makes for a good challenge.

It is very easy and very quick to write simple scripts and small utility programs. But only if the modules you hope to use are compatible with the version of python you have installed.

The biggest relief for me was the built-in data structures, I did not have to look for or write my own templated data structures. Along with data structure I find that I prefer Python’s weakly typed arrays, mixing numbers and strings without the use of a custom data structure is a real time saver.

Overall while I’m struggling with the language I’m going to continue using it as it has a lot of scope for the future with its popularity in web app development and game scripting. Hopefully the guys on top sort a few of the language issues and move to Python 3+ and we can all live in peace.


One Response to “Gripes with Python”


  1. Minimum requirements for game programming « Toughaspixels Blog - May 26, 2011

    […]  I strongly discourage you to start of in Python, I dislike the language you can read about it here, other than the reasons mentioned in that blog post I feel that Python, particularly in game […]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: