Why Python?

I have been asked this question more than once. My answer is pretty simple. Try it for a few days. Pick a few sample problems and try them out. Convert problems from your existing language and feel the difference.

There are other (some what esoteric) answers, of course. Python is a very high level language. You can choose your style – imperative, object oriented and functional. You can even mix them up. But the benefit of this is difficult to explain.

For me, it is very personal. Many people I respect and admire are Python programmers. Some times I look at the sheer elegance of the solutions and almost cry with joy. That is good enough. A bit of my background. I come from a variety of language  background. Started programming when there was no assembly language (in direct machine code), to Basic Plus, Cobol, C, Visual Basic, lots of SQL (not really a programming language), a very small dose of Java and now to Python. I don’t program a lot. I wish I did. But when you run a small startup and have to do lots of other things, programming is the last thing on your mind. Programming requires focus, attention and lots of patience and deep thinking. At least the kind of things we do.

I thought the best way to tell people Why Python is to simply find why others love it and put it all down in this place. Hence the page. I don’t go looking for these quotes. I add them when I encounter them.

From “Collective Intelligence”

All the example code in this book is written in Python, an excellent, high-level language. I chose Python because it is:

  • Concise -Code written in dynamically typed languages such as Python tends to be shorter than code written in other mainstream languages. This means there’s less typing for you when working through the examples, but it also means that it’s easier to fit the algorithm in your head and really understand what it’s doing.
  • Easy to read – Python has at times been referred to as “executable pseudocode.” While this is clearly an exaggeration, it makes the point that most experienced programmers can read Python code and understand what it is supposed to do.
  • Easily extensible – Python comes standard with many libraries, including those for mathematical functions, XML (Extensible Markup Language) parsing, and downloading web pages. The nonstandard libraries used in the book, such as the RSS (Really Simple Syndication) parser and the SQLite interface, are free and easy to download, install, and use.
  • Interactive – When working through an example, it’s useful to try out the functions as you write them without writing another program just for testing. Python can run programs directly from the command line, and it also has an interactive prompt that lets you type in function calls, create objects, and test packages interactively.
  • Multiparadigm – Python supports object-oriented, procedural, and functional styles of programming. Machine-learning algorithms vary greatly, and the clearest way to implement one may use a different paradigm than another. Sometimes it’s useful to pass around functions as parameters and other times to capture state in an object. Python supports both approaches.
  • Multiplatform and free – Python has a single reference implementation for all the major platforms and is free for all of them. The code described in this book will work on Windows, Linux, and Macintosh.

Please take a look at the Python Resource Page for starting points, useful links and self-paced learning.

One thought on “Why Python?

Please Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s