Why Web Programming Matters Most
Python never had a chance against PHP
Ok so there are these two articles. Both start to deal with Python vs PHP. I suppose this issue is close to my heart if for no other reason because I currently manage an application that is half written in both. I have also gone down the path where I tried to do everything in Python because it was such an elegant language, and ended up giving up and switching back to PHP. Not just because of some issues I faced working with Python - but external ones as well.
Python suffers from a serious popularity problem. People who like it love it. But most people have never even heard of it (although this is improving). That has a dramatic impact on the usefulness of the language to me. Because even though it is much older and more mature than PHP, there are fewer people who:
- Build in it
- Release apps in it
- Write books about it
- Write web sites in it
- Run conferences about it
- Write magazines about it
- Train people in it
- Have experience with it
That means when I go to hire for python it’s harder to find canidates who are experienced in the language. When i need a tool to tack on to a project I’m buidling there are fewer choices.
Neither the Python nor PHP community is great at marketing. You have to assume that people are voting with their feet (or their typing hands as it were). And that is self reinforcing. Once you go to a book store and see 20 books on PHP/MySQl and find 2 on python - you get the feeling that everyone else is going one direction. So even if you add even more to Python in terms of features that doesn’t guarantee that you will reverse the trend that lots and lots of new developers cut their teeth on PHP not Python. And I will tell you if you don’t get them when they are young you will only convert the ones that are serious enough developers to learn more than one language.
A couple of years ago, I was at OSCON and a presenter talked about how when you pick a language you aren’t just picking a language, you’re choosing to join the community and people who work in that language. So to make a gross generalization, even though most developers can code confortably in multiple langauges - the communities related to each are very different. Just look at the Java community as compared to the Perl community to see a perfect example of this.
I won’t characterize the Python community because I don’t feel I’m part of it.
On the PHP side - here are just a couple of things that suck about PHP
- There are inconsitantly named functions.
- The language and be messy.
- It allows you mix your presentation and logic.
- It is terribly inefficient by recompiling the code on ever excution.
- $ variables are so 1980.
- The object model is only now starting to be fixed.
- Most of the code out there is complete crap.
I would say that the community is really like that old saw about the millions of monkeys at typewriters. You take all that terriblness,you add in tons and tons of coders who don’t know a data structure from their elbow, and you get a moutain of crap code.
But in the end - the monkeys produce Shakespeare. That’s right I said it. There is so much code out there that sometimes people get caught up in the crappiness of it all , but that doesn’t mean that all of it is crap.
For example right now I’m writing this using a piece of PHP software that isn’t crap called WordPress.
In PHP, people just get code out there. And yes it sucks, and yets it is terrible, but it is out there. And if it is a good idea it will get better.
Truth to tell I’m not sure any of the language advocacy really matters anyway. People choose a language and try to do what they need to do. If they can, they do. If not, they give up or try something else. It’s a simple loop that means people pick the first solution that is good enough. The market has already answered how it feels about PHP and Python.
I see a lot of parallels between this discussion of Mac OS 1-9 and Windows. I was an old school Mac user. I loved it. It was great. It had a few problems but they were nothing compared to the problems that I saw with Windows 9X. And I made the same kind of - why do people choose such a sucky platform - Mac is better arguments with my pc friends. And it didn’t change anything. Apple eventually understood that - they changed dramatically with Mac OS X. I will tell you based on the number of new power books I see among my peers they have done something right to turn the tide. If you really want Python to do the same, you need to figure out how to change the playing field. Otherwise accept that you have a great language that is clean and elegant and just not used very much.
As one last aside, I also find the advocay funny - because I don’t believe that the language is as important as I once did. Sure it can make things easier on you, but the reality is there are a lot of things that going to building a great application that have to do with presentation, flow, meeting a users need ….. that are the same struggle in all languages.
January 4th, 2008 at 4:58 pm
Wow… very valid points. I’ve been looking into Python when I found your post on Google (just searching for “PHP vs. Python”). I wish more developers had the open mindset you have. I’ve been tinkering with Ruby on Rails and when you read RoR vs. PHP articles you get more flag-waving then you’d find on the 4th of July - for one side or the other. And that’s usually accompanied by a whole lot of finger-pointing.
I like how you deftly point out that there is so much more than the language that makes a project succesful. I agree that W/P is one of the great hoorahs in the PHP world, just as Django is in the Python world. Good people can work hard on projects and create good things - almost regardless of language. When you think of RoR, you think of Basecamp and the 37 Signals team… and then you draw a pretty big blank after that. I think they could have done equally well with PHP or Python - they just went with RoR on a hunch after being convinced by DHH and the rest is history. How many other custom server languages that were also approved in a hunch have never seen the light of day, much less a near cult-like following?
Thanks again for the keen insights.