A Single Article

Read it, comment, and share it with your friends

Making the move to Python

Posted March 3 in Technology.

For the past few years I’ve been almost exclusively dedicated to PHP development. At my last job I was forced to learn Perl so I can legitimately say that I know it, but considering that PHP came about because Perl was too hard to use, I’ve always preferred PHP. With good reason too; it’s fast, it offers decent OOP with version 5, it integrates tightly with Apache and MySQL, and it’s very familiar to me as a person who did a lot of development in C. Recently, however, I’ve hit some roadblocks in my attempts to optimize PHP, and I had to find an alternative that would solve those problems. I’ve settled on Python.

In all honesty, another language is just another language, so I don’t care that Python is more syntactically elegant than PHP. My reasons for using Python, and why I would actually make such a significant move, are:

  • Python actually has threading, which means I can do fire&forget processes without forcing users to wait for script completion, and job queues for operations that would normally overload the server if I tried to execute them immediately. These features make write-through and write-back caching systems very possible.
  • Python has very elegant connection pooling solutions. Connection pooling is basically essential for any application that puts very high load on a database.
  • Python’s Memcache client can actually handle multiple Memcache servers, which is great because it’s much more scalable and affordable to use a bunch of small, 1 GIG RAM servers than one large 4/8 GIG RAM server for your Memcache deployment.

All of these are things that are both, a) not in PHP, and b) essential to the kind of high-performance work that I want to do. So it’s decided: I’m going to start doing my new projects in Python. I’ll still be using PHP a lot for applications that I have to manage, or for working with Wordpress, but I’m excited about working with Python; it seems like the Python community is full of people who really care about performance, and there are a lot of smart things being done there (just look at Django, SQLAlchemy and Mako).


Get a Trackback link

1 Comments

Responses to my article
  1. Lucas Murray March 4, 2008

    Welcome to the new world. Being a PHP-to-Python mover as well I can say that you will find quite a lot of things in Python that are much nicer and easier to work with than PHP due to the complete and thourough OO approach of the language. =)

Leave a comment

Share your thoughts with the world

You can use Markdown, or you can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

Please keep comments respectful and on topic.

This form is guarded by Akismet, so don't waste your time trying to submit spam. It won't work. Ever.





Stay on top of new updates at this site: Subscribe to the Feed!