Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Which mainstream language would you have chosen in 2003 that you think would have had similar success?


> Which mainstream language would you have chosen in 2003 that you think would have had similar success?

Bingo. In 2003 PHP was the best option to get from zero to hero.


As much as I'm not a PHP fan these days, you are completely correct. In 2003, you had CFM (which MySpace actually used at first), Java (and probably some overly complex framework like Jakarta Struts to go with it), CGI, or the new ASP.net. For a college student to do a quick HTML doc with some code interspersed here and there, PHP sounds like the ONLY viable option that didn't have you spending money on licensing, or setting up some huge infrastructure.

I used PHP/MySQL too as it was just dead simple for most things.


Any. Really, any. Facebook is throwing a lot of engineering effort into fixing things that now matter to them, but didn't when they started (and were small).

They could have picked Perl CGI's and it'd still have happened (perhaps Perl 6 would be a success these days).

I don't think PHP has played any role in bringing FB to the size it is today (programming language does not translate to number of users signing up). So yes, any mainstream language available in 2003 would do it.


Perl was a possibility, but CGI is/was a pain to use. To get started you had to understand things like headers. You frequently had scripts refusing to run for whitespace issues relating to CRLF vs LF. You'd need to come up with your own templating language... It was just much more difficult.

Also Perl libraries typically require superuser rights to install. That's a big deal if you're a poor student using shared hosting on your fun hacking projects.

Python really wasn't an option. mod_python by default required you to restart Apache whenever a python file changed. It was designed to be configured by sysadmins on dedicated servers... if you wanted something you could hack together an put on a shared host, it just wasn't an option.

Also the hot Python framework in 2003 was Zope. No one uses Zope anymore. For good reason.

Ruby was much smaller, and this was pre-rails so it didn't have any significant web framework. I'm not even sure if there was a production ready way of hosting ruby scripts.


> To get started you had to understand things like headers

since when is this a problem? really.


To make something accessible you need to let people learn it one small chunk at a time.

PHP lets you ease in, starting at html with some inserted php code and working your way up to more complex code.

CGI, at least as I recall, required you to return valid HTTP responses with correct headers. That's a big jump from simple HTML.


I believe Python might have worked. It's grown well as a web development language since then by itself. It may have forced several rewrites before WSGI came about. It is a relatively easy language to learn, to hire for, and has few massive warts. (Ruby is roughly in this category too, in my opinion.)

I believe Perl probably would not have worked. It hasn't grown much as a web development language since then (although it has some great web frameworks). The language itself has languished in both development and community growth, and it fairly esoteric and certainly harder to learn than Python and PHP, and would have been harder to hire for. It seems unlikely that pre-2010 Facebook to meaningfully have changed the trajectory of the language (ie, Perl 6 being a success).

I don't think Java, C++ (or C), Cold Fusion, ASP, Haskell, Ocaml, and many other languages would have worked, for a bunch of reasons. Harder to hire for, harder to iterate with, more costly in terms of infrastructure, harder to teach/learn, and so forth.

PHP isn't a totally insignificant part of Facebook being as successful as it has been. A good-enough language choice was necessary, at least, and PHP it seems was a good-enough choice.


The point you "Anything but PHP" guys seem to conveniently ignore (or perhaps, not comprehend), is that at Facebook scale, you are going to have issues with many of these things regardless of what language you chose. They have specifically made this point many times. You and others point to some hand-wavy magical language which somehow doesn't have any issues when serving hundreds of millions of users. That doesn't exist.


Do you think perl would have been much better? Either way, the point that he was making was that there were pretty slim pickings back then. Certainly the dominant languages/frameworks of WD these days (python, ruby, node) didn't exist. Or by another token, the only dominant one that was also strong back then is PHP, the one they chose.


Yeah, Node didn't exist.

Python was over ten years old in 2003. In Python web development there had already been CGIs, mod_python and two major releases of Zope, with hope of Zope 3 on the horizon.

Ruby is almost as old as Python.


I'm aware that they existed, but clearly they were very immature as compared to how they are now. PHP on the other hand was in it's heyday, and (clearly) fulfilled all of the needs of Zuckerberg and the other developers. A suggestion at the time that they use a language like ruby or python would probably never have been made, and for good reason - and it almost certainly wouldn't have been adopted. It's just not realistic to suggest that early FB had this vast array of choices for which language to use.


I disagree. Perl would have likely crippled them, due primarily to the lack of Perl engineers.


Python and mod_python were available and working back then. The mysqldb python module too I think. Guess somebody just didn't like python :)


I got my first job in 2003 and it involved PHP development. I remember well the state of affairs then. Yes, PHP was the most pragmatic option for getting things out the door in those days. Beginners getting started today don't know how lucky they are in terms of tools, languages, libraries, communities and documentation available.


Engineering decisions made in 2003 need not dictate the future of the company more than a decade later. Keep the systems that are written in PHP around for their nature life. Write new systems in whatever is more sensible at the time. Lazy-load your way out of shitsville.

Of course this is vastly complicated if they been neglecting modularity and SOA for the past decade and most of facebook is still a monolith.....


Pretty much only the front-end code is written in PHP (or Hack, I guess).

Services (things like the feed, the typeahead, graph search, messages, &c.) are written in C++ and other languages - ie, the things it is sensible to write them in...


Well that is good to hear at least.

Do you know if Facebook is still trying to operate out of a single mercurial repository? Or is that only for the front-end code with services having their own repositories?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: