Python en:Introduction
17
Python supports procedure-oriented programming as well as object-oriented
programming. In procedure-oriented languages, the program is built around
procedures or functions which are nothing but reusable pieces of programs. In
object-oriented languages, the program is built around objects which combine data
and functionality. Python has a very powerful but simplistic way of doing OOP,
especially when compared to big languages like C++ or Java.
Extensible
If you need a critical piece of code to run very fast or want to have some piece of
algorithm not to be open, you can code that part of your program in C or C++ and
then use it from your Python program.
Embeddable
You can embed Python within your C/C++ programs to give 'scripting' capabilities for
your program's users.
Extensive Libraries
The Python Standard Library is huge indeed. It can help you do various things
involving regular expressions, documentation generation, unit testing, threading,
databases, web browsers, CGI, FTP, email, XML, XML-RPC, HTML, WAV files,
cryptography, GUI (graphical user interfaces), Tk, and other system-dependent stuff.
Remember, all this is always available wherever Python is installed. This is called the
'Batteries Included' philosophy of Python.
Besides, the standard library, there are various other high-quality libraries such as
wxPython
[1]
, Twisted
[2]
, Python Imaging Library
[3]
and many more.
Python is indeed an exciting and powerful language. It has the right combination of
performance and features that make writing programs in Python both fun and easy.
Why not Perl?
If you didn't know already, Perl is another extremely popular open source interpreted
programming language.
If you have ever tried writing a large program in Perl, you would have answered this
question yourself! In other words, Perl programs are easy when they are small and it excels
at small hacks and scripts to 'get work done'. However, they quickly become unwieldy once
you start writing bigger programs and I am speaking this out of my experience writing
large Perl programs at Yahoo!
When compared to Perl, Python programs are definitely simpler, clearer, easier to write
and hence more understandable and maintainable. I do admire Perl and I do use it on a
daily basis for various things but whenever I write a program, I always start thinking in
terms of Python because it has become so natural for me. Perl has undergone so many
hacks and changes, that it feels like it is one big (but one hell of a) hack. Sadly, the
upcoming Perl 6 does not seem to be making any improvements regarding this.
The only and very significant advantage that I feel Perl has, is its huge CPAN
[4]
library - the
Comprehensive Perl Archive Network. As the name suggests, this is a humongous collection
of Perl modules and it is simply mind-boggling because of its sheer size and depth - you can
do virtually anything you can do with a computer using these modules. One of the reasons
that Perl has more libraries than Python is that it has been around for a much longer time
than Python. However this seems to be changing with the growing Python Package Index