Premshree's (品速力) Personal Weblog


Previous Entry Share Next Entry
Why making a Case for Python at Yahoo! won’t work
I love strong, dynamically typed languages—like Python, and Ruby. (Folks have managed to convince Guido about the advantages of static typing, so much so that optional static typing may be available in future versions of Python. Period. The “dynamic typing vs. static typing” issue has been fucked around at all possible angles; I don’t intend to discuss this much.) This is not to say that I hate all other programming languages. However, there are languages—like PHP—that I loathe. I have good reasons—and quite silly ones as well—none of which I intend to discuss at the moment.

Yahoo uses PHP a lot. Anyway, I realize that a lot of folks at Yahoo, I’m sure, don’t like the language. The Python-Ruby-whore that I am—and now that I’ll be working with Yahoo—I began to wonder if making a case for Python at Yahoo would work. The answer, unfortunately, I think, is NO.

I came across “Making the Case for PHP at Yahoo!”, presented at PHPCon 2002. I didn’t know about the stuff Yahoo used in its early days—its own proprietary language (which lacked subroutines, by the way), homegrown RPC, etc. (At this time, Yahoo! People Search was written in Python, if I’m correct.) It’s clear that something else was required. That something else did not have to be PHP; it just had to be something else—something much better that what was being used. In essence, this was not really a case for PHP at all—it was a case for choosing another language. It so happens, I presume, that the lobbying (excuse my strong and, rather incorrect, use of the word) group, happened to be PHP enthusiasts.

The language criteria, taken straight from that presentation, were: C/C++ extensions (Python is good at this. Ruby, a lot of people contend, is even better); loops/conditionals; complex data-types; pleasant syntax (heh, I can’t help but remind you that Python is probably what comes closest to pseudocode); runs on FreeBSD; high performance; robust, sand-boxed; interpreted (or dynamically compiled); low training costs; i18n support; clean separation of presentation/content/app semantics; doesn’t require CS degree to use. Twelve of them. What programming language fits the bill? Pretty much any programming language, no? Come to think of it, what were the options available anyway? PHP, probably, was a good move.

Okay, so now we’ve graduated from a subroutine-less language to PHP. Now do we have a strong enough case to switch to Python?

I really don’t think so. Yes, Python will serve all the purposes (and more, if need be) that PHP currently serves. Reason enough? No. One important issue I have not considered here is that of performance. This whole business of choosing a language probably boils down to this, I guess. Well, a perfunctory look at comparing the benchmarks of Python and PHP reveals that Python generally has a better rank than PHP. (The original Great Computer Language Shootout page seems down.) However, the difference isn’t good enough to warrant adoption. The standard disclaimer accompanying benchmarks—that they are debatable—goes without saying. (Well, even though I said it, actually.)

Please note that I have discussed this at a highly abstracted level. We could go into the details, but I’m really in no mood to do that—I don’t see it serving any conceivable purpose. Now I wonder if there was any point in discussing all this in the first place.

If you think you have valid, pragmatic reasons to believe that Yahoo should migrate all its stuff to Python, I would really like to know.

  • 1
Nice Userpic...
btw i didnt understand a word of what you said. its all french to me :D

Heh, thanks. :)

Agreed. Your user pic rocks.

There's no way you can convince any company to move to a new platform wholesale. It all begins one thing and one project at a time.

I can assure you that there more than half of Yahoo! still runs on the old stuff and even uses ASP.

Its a heteregeneous environment and it will always will be.

- Swaroop

Right. But people (companies) always tend to move toward integration—one environment—right?

And when I said switch to using Python, of course, I meant a gradual move—but a move, nonetheless.

Earlier, on a whim, I wondered why Yahoo can’t switch to using a more sane language. I guess I was trying to answer my question. :)

Ok explain one thing to me, out of the zillions of sites out there, how many use PHP and how many use Python? After you know the ratio, please explain to me why the ratio is so. You have then answered your own question as well.

- Swaroop

More available PHP programmers than Python programmers. That's what applies to most companies.

IIRC, Yahoo! doesn't hire people just because they're "there". People get hired because they're "good".

Really? Is that the only reason?

When you know that people get into Yahoo only because they're "good", I find it ridiculous that they took a decision to use PHP simply because of the job market share. There must be _some_ technical reasons :|

as someone who has tried to hire
let me tell you it is very difficult to find good python programmers.
python, being extremely powerful, in the wrong hands can be extremely disastrous

Well, I have always maintained that the dumb things in life are more popular.

Candy pop music, PHP, ....

Have I answered my question? :-?

Right. But people (companies) always tend to move toward integration—one environment—right?

I've been working at a larger company for a few months now - larger than what I'm used to, at least. There might be the tendency to move toward integration, but every department seems to move at a different pace. And often towards a different idea of what "unity" might mean.

Department A is already migrating to solution C from solution B, which was the new unified platform a couple of years ago, while for some strange reason Department R have been using a mutant variation of solution A for six years, and have chosen to completely skip straight to solution D, which somebody mentioned in a meeting last month. Naturally, Department Q had some serious problems with the migration to Solution B, and chose to completely ignore the company-wide "unified solution". They've started working on Solution ω. I hear that Ed has already finished a draft of something he calls Solution ω, though. It looks like Department Q's Solution ω, but it is completely incompatible with any of the solutions mentioned so far.

Then there's the office in Japan...

My brain hurts just thinking about it.

Why making a Case for Python at Yahoo! won’t work

Are you suggesting that Yahoo migrate all its PHP stuff to Python? If even you had a single good reason, there has to be a business case for such a thing. Is it going to make the company more profitable?

If you're talking about new projects, then I'm guessing Python has some performance and stability problems while PHP is more suited for web apps. Then again, what type of devs are easier (and less expensive) to hire -- PHP or Python?

What stability problems? What performance problems? Please explain.

I can vouch that Python is anyday better than Perl w.r.t. performance and to put it oh so eloquently - Without Perl, Y! wouldn't run at all.

This is why I really want Parrot to really work. Then any company can standardize on one platform (Parrot) and also allow each group to choose their own choice of language such as Perl, Python, PHP or Ruby.

try a sort.

performance comparisons of the two show nothing significant if i remember a test we ran sometime in early 2003.

Yes, I was contemplating the possibility—not suggesting. And when I mean that language A is better than language B, I didn’t intend to suggest it from the POV of the developers alone. (Of course we all know what a screwed-up language PHP is, but let’s leave that aside for now.)

When I talked about migration, it’s got to be for the future good of the organization—that’s implicit, and goes without saying. I didn’t make it explicit because—apart from it being implicit—the goodness that’d result from the move is something that’s difficult to predict—well, at least for me.

Is it true that y! had a tough time maintaining y!store bcuz they didnt get good enough lisp guys ? maybe yahoo did a knee-jerk and decided they would henceforth default to something that (the strategists at y! thought) *junta* could code in ? j/k. :)

another interesting link:

I think everybody should use Brainfuck.

Lisp is a different thing. At least Python and PHP belong to the same paradigm.

lo there!

i thought i'd let you know i added you to my friends list. i came across your python recipe for generating opml out of your livejournal.



I love strong, dynamically typed languages—like Python, and Ruby.

Hmmm.... Strong ? where is strong typing in python and ruby ?

Besides, both are sloooow. Especially after seeing Common Lisp code run as fast as C and OCaml beating C.

For a dynamically typed language, Pike is pretty fast and it beats almost all scripting languages (barring Gambit Scheme which has a fine compiler to C).


Python and Ruby both are strong typed.

"Well, a perfunctory look at comparing the benchmarks of Python and PHP"

The Computer Language Shootout is active at

  • 1

Log in

No account? Create an account