Reasons for Choosing Python

From MallWiki

Jump to: navigation, search

We have chosen to use the python language (http://www.python.org/). The reasons are as follows:

1) Python has an elegant well designed syntax that incorporates object oriented programming, list and dictionary based data types and functional programming in a simple way.

2) Python is easy to learn. It has an interpreter, so one can start with simple examples and you are freed from the compilation cycle which is confusing for beginners. You can waste a lot of time trying to understand and debug unnecessary bracketing conventions etc.

3) Python promotes and in some cases enforces good programming habits. Indenting is mandatory and it has the literate programming mechanisms that turn comments into HTML documentation. It also has a unit testing framework.

4) Python has all of the components needed by behavioral researchers – an experimental programming laboratory (pyEPL), statistical and signal processing libraries (numpy and scipy) and graphics libraries (matplotlib).

5) It can be used for a wide variety of other tasks as well ­ it has fully developed web programming modules, regular expression libraries (necessary for doing corpus work) and GUI platforms. These wont be covered in the current course, but it is nice to know they are there should you need to use them in the future. Python also scales well to large applications.

6) There is a large community of users. Based on google document counts the python community is approximately 4 to 5 times bigger than the matlab community, for instance, and includes organizations such as Google and NASA.

7) It is easy to interface to other languages ­ both high level and low level. So, there are interfaces to matlab and R (but the reverse is not true). Interfacing to C is done directly ­ it does not require writing intermediate files (like mex files).

8) There is a free online text (http://openbookproject.net/thinkCSpy/index.xhtml) under the GNU open document license that has had many contributors and debuggers. The text is also available in hardcopy. There are also many other online resources (e.g. python tutorial http://docs.python.org/tut/tut.html).

9) Python is free and available on all major platforms (linux, OSX and windows)­ this means that when you leave the university environment either to go home or to start a new job, you will be able to access it where ever you are.