< BACKMake Note | BookmarkCONTINUE >
156135250194107072078175030179198180024228156016206217188240240204173119023245199011052152

Comparing Python

Python has been compared with many languages. One reason is that it provides many features found in other languages. Another reason is that Python itself is derived from many other languages, including ABC, Modula-3, C, C++, Algol-68, SmallTalk, and Unix shell and other scripting languages, to name a few. Python is a virtual "greatest hits" where van Rossum combined the features he admired most in the other languages he had studied and brought them together for our programming sanity.

However, more often than not, since Python is an interpreted language, you will find that most of the comparisons are with Perl, Java, Tcl, and JavaScript. Perl is another scripting language which goes well beyond the realm of the standard shell scripts. Like Python, Perl gives you the power of a full programming language as well as system call access.

Perl's greatest strength is in its string pattern matching ability, providing an extremely powerful regular expression matching engine. This has pushed Perl to become the de facto language for string text stream filtering, recognition, and extraction, and it is still the most popular language for developing Internet applications through web servers' Common Gateway Interface (CGI). However, Perl's obscure and overly-symbolic syntax is much more difficult to decipher, resulting in a steep learning curve that inhibits the beginner, frustrating those for whom grasping concepts is impeded by semantics. This, coupled with Perl's "feature" of providing many ways of accomplishing the same task, introduces inconsistency and factionization of developers. Finally, all too often the reference book is required reading to decipher a Perl script which was written just a mere quarter ago.

Python is often compared to Java because of their similar object-oriented nature and syntax. Java's syntax, although much simpler than C++'s, can still be fairly cumbersome, especially if you want to perform just a small task. Python's simplicity offers a much more rapid development environment that using just pure Java. One major evolution in Python's relationship with Java is the development of JPython, a Python interpreter written completely in Java. It is now possible to run Python programs with only the presence of a Java VM (virtual machine). We will mention more of JPython's advantages briefly in the following section, but for now we can tell you that in the JPython scripting environment, you can manipulate Java objects, Java can interact with Python objects, and you have access to your normal Java class libraries as if Java has always been part of the Python environment.

Tcl is another scripting language that bears some similarities to Python. Tcl is one of the first truly easy-to-use scripting languages providing the programmer extensibility as well as system call access. Tcl is still popular today and perhaps somewhat more restrictive (due to its limited types) than Python, but it shares Python's ability to extend past its original design. More importantly, Tcl is often used with its graphical toolkit partner, Tk, in developing graphical user interface (GUI) applications. Due to its popularity, Tk has been ported to Perl (Perl/Tk) and Python (Tkinter).

Python has some light functional programming (FP) constructs which likens it to languages such as Lisp or Scheme. However, it should be noted that Python is not considered an FP language; therefore, it does provide much more than what you see.

Of all the languages most often compared to Python, JavaScript bears the most resemblance. It is the most similar syntax-wise as well as also being object-oriented. Any proficient JavaScript programmer will find that picking up Python requires little or no effort. Python provides execution outside the web browser environment as well as the ability to interact with system calls and perform general system tasks commonly handled by shell scripts.

You can access a number of comparisons between Python and other languages at:

					
http://www.python.org/doc/Comparisons.html
				


Last updated on 9/14/2001
Core Python Programming, © 2002 Prentice Hall PTR

< BACKMake Note | BookmarkCONTINUE >

© 2002, O'Reilly & Associates, Inc.