PHP to python. Why?
Well.. let me give a background first. I have been working with PHP for quite some time(>3 years) on various projects from small 500 lines to more then 20K lines. I like to keep up with the latest (or should I say hot since python is in no way “latest“) trends. Lately there has been quite a lot of buzz around “which language” is the best for web development. I thought may be it is time to experiment! Firstly I am ignoring Ruby/Ruby on rails completely. I just never got to like it much to put in extra effort. The hosting for ruby can be quite expensive and I like to have complete control on my code(down to last for loop :) which I dont think ruby on rails provides. If I am wrong, someone please comment and set it up for me.
Coming back to the comparison, I really am not the right person to judge which is better. But I know for sure: Even if I can do everything possible on web through PHP, there is one thing missing. The clean structure. For those who say that there is an “object oriented” way to go about to do things in php, I would like to say that php was never designed to be used that way. There are far too many inconsistencies in php to use oop at a large scale. I came across one more funny thing about it today on Google reader. The post can be found here.
So coming back to my situation, I got introduced to python about a year back in a completely non-web-development setting. The basic syntax and structure does not look or feel like it is good for web development. But it was so clean that I wanted to code in it! But how? I had heard about Django but had never tried to use it. From its description, It felt like it would be really handy to use django if I want to develop something in python. And so I started. About a month back, I did tried to use it. To say it in one line, I could not get it to install. The pages on django website are far too long to fit in my somewhat small brain. I could never get over with the problems compatibilities.
For some reason, my love for python has not gotten over yet. I’ll try to begin using it one more time. This time I have a project that I would like to do with it and so will try to be more careful.
I guess I’ll post soon how it went.
Tags: internet, php, python, web development

September 4th, 2008 at 10:57 pm
PHP version looks cleaner and more understandable for me.
Also any person who knows all three would say the same. (Or I may be wrong due to poor variable naming)
See the comparision below:
PHP Perl Python
Web application Good Best (ModPerl rules) Better
Stand alone application Good Better Best
Algorithms Good Better Best
Libraries Good Best Better
Speed I Good Best Best
Speed II (With time and extension) Gr8 Gr8 Gr8
My simple conclusion:
1) Pick any language for any task (Even stupid task like writing desktop game programming with PHP). But Learn to write uncluttered syntax.
2) Do all the things possible with the avaliable libraries. If there isn’t one you want develop yourself.
3) If speed is ok ignore all other issues. If speed is not ok extend using C/C++.
Cheers,
MB
September 29th, 2008 at 11:33 pm
I would modify 2) and 3):
2) If it is a simple task, see if you can write the code yourself instead of using a library, unless you have a deep understanding of the library. The most difficult problems are because of code you don’t understand.
3) If speed is not ok, then you’re thinking of the problem the wrong way. Rethink design and find the right way, only exception being GUI responsiveness maybe.