Subscribe
About

Python: The last language you will ever learn

Johannesburg, 17 Sep 1999

The first thing everyone asks is: if Python is so great, why haven`t I heard of it? The answer is the same as it was for Linux a couple years back. Python is free - no one but the end-user has any direct gain from downloading free products - so the only advertising comes from word of mouth. This will remain true until lots of cash becomes available. Linux is starting to come of age in this regard, and Python, like other free projects is sure to follow suit.

Python is an object oriented scripting (interpreted) language for Rapid Application Development (RAD). It came onto the scenes in February 1991 as the sole work of Guido van Rossum of the Netherlands. Today there are over 200 contributors to his base distribution.

Python features the best of a number of programming worlds. Its indentation (tab stops) determines its precedence - instead of the cumbersome curly braces of C, Perl and Java. It is a highly expressive language as well as being extremely readable. Anyone with programming experience can understand a Python program - even if you`ve never seen Python before.

These qualities mean that Python is excellent for large projects, because anyone can easily maintain and update code written by someone else (its really difficult to write bad Python code).

It is object-oriented, through, to its very foundation, and gracefully supports code reuse and extensibility. Programmers soon fall in love with it when they discover the time it saves. Compared with any other language, Python converts claim that it cuts development time to a third or less.

One important reason to promote Python is its learning curve: Python can be taught in a few days to anyone that has programming experience. It would also be much easier as a first programming language than Basic or Pascal. In the words of Guido: "We compare mass ability to write and modify software with mass literacy, and expect that equally fundamental changes to society may ensue."

The Python Way is explained by Tim Peters, Python developer and light-hearted advocate:

  1. Beautiful is better than ugly.

  2. Explicit is better than implicit.

  3. Simple is better than complex.

  4. Complex is better than complicated.

  5. Flat is better than nested.

  6. Sparse is better than dense.

  7. Readability counts.

  8. Special cases aren`t special enough to break the rules,

  9. Although, practicality beats purity.

  10. Errors should never pass silently,

  11. Unless explicitly silenced.

  12. In the face of ambiguity, refuse the temptation to guess.

  13. There should be one - and preferably only one - obvious way to do it.

  14. Although that way may not be obvious at first unless you happen to be Dutch.

  15. Now is better than never,

  16. Although, never is often better than *right* now.

  17. If the implementation is hard to explain, it`s a bad idea.

  18. If the implementation is easy to explain, it may be a good idea.

  19. Namespaces are one honking great idea - let`s do more of those!

Programming in the free software world follows a different paradigm to that in proprietary development. In the proprietary world if you require functionality, you buy it or build it - usually so that only you can use it. With free software you create a library for everyone in the world to use, maintain and extend. Python is a model of the free approach. "Modules" can easily be developed for Python to extend its functionality.

New ones pop up every week or two. For instance, Python has a Math/Matrix module that is closing in on state of the art engineering tools like MatLab and Mathematica. Its widget libraries allow intricate GUI environments to be neatly created. Its interfaces to various free and proprietary SQL databases facilitate business application development, and a comprehensive web module allows for CGI scripting. What`s more, Python has been around longer than Java, and has a far richer set of extensions, which are freely downloadable from the Net.

Python is most popular with Unix users, and especially Linux users. This is where you will find the most support and advocacy. There are however versions for the Mac, OS/2, Windows and DOS, and it is possible to develop platform independent GUI programs with Python using Python`s wxWindows extension module, and make use of native system libraries as though you were programming in C.

For those itching to give it a try, O`Reilly has some worthwhile titles. However, the best way to start with Python is to get a popular Linux distribution (all these come standard with Python), and dive straight into the online Python tutorials (www.python.org can be your first stop on the Web). Python also has a dedicated newsgroup: comp.lang.python for those needing interactive support and wanting the latest Python news.

Share