The Python programming language
I started programming with Fortran-66 and Algol-60 in the early 1970s and moved on to Ratfor and Pascal in the early 1980s. Since then I've tried a variety of other programming languages, but Pascal remained my favourite for a long time.
Python has been around for a decade, but I didn't discover it until 1999. Already it seems so pleasant and convenient that I've taken my books on other programming languages and put them away in the attic. Unlike Smalltalk, for instance, it's so easy to understand that I installed it for the first time and could almost immediately write small but useful programs with it.
Advantages of Python:
- It runs on almost any computer or operating system.
- The online documentation that comes with it seems thorough and good (though I've also bought an introductory book).
- Almost no tedious declarations. As in Smalltalk, variables are pointers to objects, and can point to any type of object.
- Very convenient hassle-free strings, lists, and dictionaries that will store as many objects as you like with no need for you to know in advance how many you want to store.
- Block structure is indicated by indentation, so there's no need of Pascal's begin and end or C's { and }.
- The function library is extensive and provides plenty of useful-looking functions.
- It's free. Just download it from the Web site.
- If you want other people to use your Python programs, you have to persuade them to install Python — and they have to install the whole development environment. A smaller runtime-only version of Python could be provided, but isn't. Python for Windows is an eleven-megabyte download.
- There is no standard Python graphical user interface library. Instead, it borrows from elsewhere. The nearest thing to a standard is Tkinter, which is supplied with Python and seems to be adequate (though not easy enough for my liking). But Python's own documentation doesn't cover it, so I've had to buy a book on it.
- Lists are indexed from zero (0, 1, 2, 3, etc.). This doesn't come naturally to me nor to most other humans, who are accustomed to count things starting at 1.
- Perhaps as a consequence of this, ranges are specified unintuitively. The
equivalent of Pascal's
for i:= 5 to 20 do
is in Python
for i in range(5,21):
That's not a misprint: in Python you don't simply give the end of the range, you give a number that has to be greater than the end of the range. Duh. - Python is case-sensitive. The variable names FRED, Fred, and fred are different and can have different values. This is not a major problem, but I think it's an unnecessary mistake. Humans are not case-sensitive. Perhaps this will be corrected in a future release.