Slashdot Mirror


Yahoo Moving to PHP

Erek Dyskant writes "Yahoo has decided to switch from a proprietary system written in C/C++ to PHP for their backend scripting. Here's the notes from a presentation by a Yahoo engineer at PHP Con 2002."

9 of 733 comments (clear)

  1. Seems like a silly move... by FortKnox · · Score: 4, Interesting

    Going from something speedy and efficient to PHP.

    Why not switch to J2EE? Obviously, this is an extremely large enterprise web-app. They could take full advantage of all EJBs and Webapp clustering. I just don't see why you'd use PHP, when J2EE has so much more of an advantage on an enterprise level.

    On reading the slide show, the reason not to pick J2EE:
    you can't really use Java w/o threads
    Threads support on FreeBSD is not great


    Is this really a bad thing?
    Especially for the advantages EJBs give you??

    --
    Good quote, too many chars. Seriously, the slashdot 120 char limit sucks!
    1. Re:Seems like a silly move... by glwtta · · Score: 5, Interesting
      Hm, if they are rewriting their entire app, wouldn't a move from FreeBSD to some other UNIX(-like thing) be small in comparison?

      I mean seriously, I'd love to hear the pros and cons of the "Moving our stuff off of FreeBSD" vs. "Having to maintain everything in PHP instead of J2EE" discussion.

      --
      sic transit gloria mundi
    2. Re:Seems like a silly move... by FortKnox · · Score: 5, Interesting

      Because J2EE is slow to develop in

      I'd argue that if you use 2.0 EJBs and JBuilder, I could code just as fast as any regular language, but scripting languages are easier to slap code into.
      Now, good scripted PHP vs good abstracted OO Java. To code from scratch, PHP'ers could lay down code quicker. Java is easier to maintain and easier to add onto (if properly architected). In the end, I'd call it even ground.

      slow at executing

      Java 1 was slow. That was like 5 years ago. Go download JBuilder and run it. Made in C++, right? BUZZT! Its Java. Java has come a long way.

      J2EE is beautiful in theory, but not in practice

      Well, my job is a J2EE developer, so I guess the complex, enterprise level application that is running currently in front of me isn't java, cause it isn't beautiful in practice.

      Anyone with that only on their resume will have to shape up the next years, when PHB's stop buying that particular buzzword and move on to the next.

      Go look at monster. J2EE is one of the few languages that people have been hiring in throughout the recession. That doesn't sound like something PHB's are gonna just stop hiring.

      --
      Good quote, too many chars. Seriously, the slashdot 120 char limit sucks!
    3. Re:Seems like a silly move... by lateefj · · Score: 4, Interesting

      J2EE or PHP?
      I had to make this decision myself. I would like to share some of the reasons I chose J2EE over PHP.
      J2EE is a specifaction that is implemented by Java. PHP is a scripting language that runs on web servers. One of the problems I came up against was writing PHP was fast but as soon as the application left the modules that where included by PHP you would have to write them in C/C++ and compile them into PHP. This was NOT maintable and C/C++ are not RAD (Rapid Application Development). Basically PHP is limited to the running inside of Apache which for a small site is not much of a limitation but all of the website I have worked this was a huge limitation. For example there is no way to schedule a PHP script to run without outside software. Java is a langauge that provides a lot of different ways to schedule events.

      PHP has a couple major database interface problems that Java does not. One the database abstraction exist only by extention such as PEAR. Persitant connections create a connection for every Webserver process. So if I have n number of connections to the webserver I have n number of database connections. Since the query took a lot less time then it does to send the web page back to the client. For a small site this is no problem because there are very few connections at a time. But when you start dealing with multiple servers and large numbers of user connecting at the same time the database server soon cannot support he number of connections required. If you set connection pooling off this works OK for MySQL because it uses threads (this I don't get MySQL threads are ok but Java ones are not?) but Ohh.. my if one was to every use a database design for large systems such as PostgreSQL you would be creating heavy processes for every connection and again this would not scale. J2EE application servers use connection pooling :) and this is configurable so you can optimize it based on YOUR application not the number client connections.

      PHP caching I have used very little of. I used the PEAR caching system and it works OK. The J2EE caching that I have used is the Jboss implementation. The J2EE caching is so much more finegrained than the PHP caching that it is almost like comparing applies to oranges. But J2EE has a concept of row level caching vs. PHP which has a concept of query level caching. My experience is that J2EE caching is faster and much more intelegent.

      PHP supports objects ... (sorta'). In the projects I have worked on it is really nice to have name space which is something PHP does not support. As the applications get larger I found that keeping track of all the PHP functions became cumbersome. Then I started using PHP objects which at first where great except they are limiting after you have used a more fullfeatures language like Java or Python. I thought I read somewhere that you can do pass by refrence in PHP but I haven't been able to find that link. I found out that the PHP objects where by default pass by value when I ran into out of memory errors. In small sites with small object complexity PHP works fine.

      Generally I have found that large application evolve into supporting things I could have never imaged when I start working on it. If I where a C programmer then PHP might make sence because I could extend it to support all the features. But I don't have the time or knowlegde to become a really good C programmer so I use J2EE (Jboss).

      --
      Pedro For President!
  2. fascinating by erikdotla · · Score: 5, Interesting

    I'm glad Yahoo is moving to OSS and recognizes the dangers of proprietary software.

    I'm a Perl guy, and it was very interesting to note that:

    1. Perl beat PHP in all of their performance tests
    2. They listed TMTOWDI as a "con" yet,
    3. One of the requirements was a language that didn't require a CS degree to use. TMTOWDI helps that, I've noticed.

    I'm saddened that Perl has lost a major cheerleader but at least it isn't MS technology.

    Even so, I can actually see how PHP is more appropriate. For a site with lots of content, with code mixed in, PHP's "code in the page" model is more ideal. I've had to reinvent something similar in Perl many times, appropriate for whatever I'm working on at the time (I don't like Mason, I prefer my own solution.)

    I can see how a solution such as mine - where I prepare an output hash of data then show a webpage by opening and printing the file, using s/// to insert my hash contents with a search/replace method, isn't exactly ideal for Yahoo's high-content needs.

    While PerlScript somewhat solves this problem, I remember it being buggy and certainly not as mature as PHP in that regard.

    I can't say that I think this is a mistake on Yahoo's part - more like, I think if they wanted to, they could solve Perl's shortcomings and reap the benefits that Perl has over PHP. I guess they're just not interested.

    The presentation was a little vague, wish I knew more about the details of their decision.

    --
    # Erik
  3. Re:Why is PHP so bad? by watchful.babbler · · Score: 4, Interesting
    Is there something inherently bad about PHP that should make me shy away from it, or is it more of a religious debate?

    Praise the Lord and pass the pretty-printer! I'm not a PHP fan, but I don't think any of us can make a strong argument against it, except that it's not a general-purpose language, and thus falls into the same geek category as Cold Fusion, Office macros, and, well, ASP. There's a very strong bias against using tools crafted for the job when the job is defined as a presentation method.

    If you like, blame the tacit geek belief that any language they learn should allow inline assembler, have CORBA bindings, multithread, and let you hack a serial port monitor to control intelligent coffeemakers.

    --
    "Freedom is kind of a hobby with me, and I have disposable income that I'll spend to find out how to get people more."
  4. Re:Maintence must be easier by dimator · · Score: 5, Interesting

    I can't for the life of me figure out why so many people pick it for web apps.

    I guess everyone is smoking crack except you. Seriously, why does MySQL get all this smack talk? I use it because its easy, every language I know of has bindings for it, its fast enough, and its stable. PLEASE spare me your "But XXX does that too, not to mention bla bla bla!" No, I won't switch, because I learned MySQL first (as I'm sure many others have) and so far it hasn't let me down.

    --
    python -c "x='python -c %sx=%s; print x%%(chr(34),repr(x),chr(34))%s'; print x%(chr(34),repr(x),chr(34))"
  5. Re:Why is PHP so bad? by Grip3n · · Score: 4, Interesting

    I myself have been an avid user of PHP for many years and I love it, but true, there are many that despise it.

    Why?

    Because like Mr. Radwin says(the author of this presentation), PHP is simple to use. It has quite a bit of error protection and it deals with sloppy code. The elite programmers amoung us hate this - they see people whom have not spent the last 12 years of their life learning a language but producing the same (or similar) results. PHP itself is great, and the fact that a corporation like Yahoo! has decided to use it over all the other alternatives just re-enforces that.

    --
    To make a pun demonstrates the highest understanding of a language
  6. Re:You forgot about Java... by Pengo · · Score: 4, Interesting


    Some of the larger projects I have worked on , where integration is important and a key to the success of the product, JAVA seems to be the best bet.

    Not to say that things couldn't be done in PHP, probably can... but I have had a lot of luck in writing all my business logic and middleware in JAVA and then using JSP or Servlets + Velocity for presentation. The thing is, it's not something that someone can do without a middleware engineer and a implimentation engineer.

    I have been coding java middleware code ware for almost 3 years now, some of it integrates into web based services, some of it ties into legacy workflow systems and even tied into a IBM mainframe, I just can't IMAGINE doing all of that in PHP... I would of been laughed out the door of my company as a matter of fact with a pink slip in my hand.

    The strength of being able to pull in other 3rd party libraries for various tasks that come up, JAVA is first rate.

    I worked for a company that had a pretty complex logistics based system that integrated with a German logistics ocmpany.. was ALL done in PHP.. I couldn't believe it when I saw it to be honest, but to say the least... was VERY dificult to manage the application as it grew to many hundreds of classes and pages. The company ended moving to an EJB/JSP solution on websphere I think, and eventually was able to cut out about 1/2 of their engineers because the API became quite manageable by fewer people.

    You can't call JAVA hype any more than you can call COBOL, FORTRAN c/C++ hype, because the level of profound impact JAVA is having on the industry at the moment is to those levels IMHO.

    NOW.. if the project doesn't really reach beyond basic web applications, yes, even very large companies have such projects.. I see nothing wrong with PHP. It's actually a breath of fresh air when I need to hack something out quick and simple. I use HORDE+IMP for my own personal email and the email server for my wife on my linux box.