Dev: February 2009 Archives

Python *sigh*

|

After years of dislike, I may have to admit that I'm not entirely filled with hatred for Python. This did not come voluntarily, mind you. My love of laziness naturally breeds a lot of small projects; why repeat a task over and over when I can code something once and not have to think about it again?

My love of laziness was thrilled when I introduced it to web services some years ago. Now there was a place for my apathetic side as well - why bother learning what over people have coded, when all I have to do it point my code to a web service (ReST was a natural choice *rimshot*)?

A situation arose where there only real way to get something done without reinventing the wheel (avoiding a joke about things being chowned and chgrped to 'wheel') was to consume a web service. Finding a chunk of code where the consumption was already written was easy, but it happened to be in Python. I swallowed hard and decided to use it anyway, creating a Frankensteinian script wherein PHP passed arguments to a Python script which made the web service call and passed the results to a Ruby script (I never managed to work in Erlang).

As the benefit of that particular script became apparent, I made use of the Python section again and again. I finally realized that it was impossible to do any sort of sane version control since there were at least three script files to be updated per 'script'.

On one particularly slow day I decided to try to rewrite one of the aging scripts in pure Python. It worked and was a lot cleaner. I've written some subsequent scripts in pure Python as well, and a lot of my dislikes remain:

  • I hate converting every single number to a string before concatenating it to another string
  • Python, your implementation of lists is hideous
  • I don't want to have to track eleventy billion import statements
  • The whitespace is just annoying. I know how to write clean-looking code. Sometimes I just don't want to.
  • Get a damn case command. Virtually every other language in common use has one.
  • As I've said before: Twisted Python (which admittedly is not part of the Python core) tries way too hard to behave like Erlang. Just learn Erlang and be done with it.
  • String manipulation is the most counter-intuitive crap I've ever seen. x86 assembly makes more sense

That being said, it's just possible that perhaps Python isn't quite as evil as I once thought. Python, at least you're not Java.

About this Archive

This page is a archive of entries in the Dev category from February 2009.

Dev: November 2008 is the previous archive.

Dev: March 2009 is the next archive.

Find recent content on the main index or look in the archives to find all content.