Apr 15 2010
∞
Why we are “Python Fanboys”
I think I can safely say that we’re all Python evangelists. In fact, I’m pretty sure my first conversation with ‘FixedByDrift’ revolved around just how enamored with Python he is. Likewise my first email with ‘AmbiguousBase’ was a code exchange of microsatellite finding software written in Python. We just love Python. So why should you learn to love Python too and why do we use it so much? A few salient points follow:
- Python is an object oriented scripting language that is easy to write. More importantly, it’s easy to read. Instead of a cluster-f#$k of brackets and colons, if you’re ever tried to decipher C or Perl code you didn’t write you know what I’m talking about, indentation is used to delimit code blocks. This makes for some surprisingly clean code and for code that is easy to collaborate on.
- Python has useful scientific modules. Numpy, Scipy and MatPlotLib make Python an essentially free version of Matlab. BioPython lets you interact with biological sequences and many of the online biological repositories. Rpy2 allows you to interact with the R statistical language from within Python. However, since Python is a general-purpose language, you can seamlessly combine these modules with web frameworks (e.g., Django) and GUI frameworks such as PyQt.
- The type of an object is defined when you create it. There are no complicated scalars, floats, and hashes to keep track of. If you want to create an object that consists of a string the syntax is simply:
>> test = 'test string'
It’s really as simple as that. In a similar vein Python deals with pointers behind the scenes. You don’t ever have to declare pointers when writing Python code.
That is all I can think of for the time being. I’ll continue updating this post as more things I love about Python come to mind.