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
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.

  • 1

Log in

No account? Create an account