Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
PHP Programming

Yahoo Moving to PHP 779

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."
This discussion has been archived. No new comments can be posted.

Yahoo Moving to PHP

Comments Filter:
  • Oh my god! (Score:3, Funny)

    by SpanishInquisition ( 127269 ) on Tuesday October 29, 2002 @04:58PM (#4559321) Homepage Journal
    Cats sleeping with dogs, PHP useful at something!!!
    • Re:Oh my god! (Score:5, Informative)

      by mr_z_beeblebrox ( 591077 ) on Tuesday October 29, 2002 @05:18PM (#4559514) Journal
      PHP useful at something!!!

      I didn't expect the spanish inquisition. Really, though. PHP is like PERL made for the web, it has easier access to databases than any other language I know of (which are only a few granted but Perl and C are among them).
      I would say more but Language choice tends to get religious. Everyone thinks theirs is superior and few will just yield to my choices :-)
      • Re:Oh my god! (Score:3, Interesting)

        by tzanger ( 1575 )

        PHP is like PERL made for the web, it has easier access to databases than any other language I know of

        I disagree; Perl's DBI interface is *far* simpler (and the functions are not DB-specific) like PHP's. (I think PHP solved that in the not too distant past though)

      • Re:Oh my god! (Score:4, Informative)

        by Anonymous Coward on Tuesday October 29, 2002 @06:34PM (#4559938)
        I hate how uninformed people (I'm not saying you are, but you are certainly propagating the myth) always say something to the effect that PHP is "web only". This is downright false. I've written complex shell scripts with PHP, and tend to do so most of the time over sh or Perl.

        #!/usr/bin/php works just like the Perl alternative.
  • hmm... (Score:2, Funny)

    by seann ( 307009 )
    *applys for a job*
  • Dangers (Score:5, Funny)

    by briggsb ( 217215 ) on Tuesday October 29, 2002 @05:01PM (#4559360)
    I hope the developers at Yahoo! understand fully the dangers of using PHP [bbspot.com].
  • It makes sense ... (Score:5, Insightful)

    by SuperDuG ( 134989 ) <<kt.celce> <ta> <eb>> on Tuesday October 29, 2002 @05:02PM (#4559369) Homepage Journal
    PHP has begun to prove itself as a very mission-critical, cross-platform, well versed, and stable scripting language. For what Yahoo does and for the optimizations that have come in newer versions of php this makes a whole lot of sense. If yahoo plans on using a mod_php with apache 2.0 then I can see them even getting more performance gains. There's no way to tell as I've never actually seen the system they use currently.

    Obviously open source DOES apply to the corperate world.

    • by rseuhs ( 322520 ) on Tuesday October 29, 2002 @05:18PM (#4559511)
      Where have you been in the last 5 years?

      If you say that open source has a place in corporate webservers, I'd say that's a massive understatement.

      Open Source (Apache and PHP) is the standard in the webserver space already and is gaining more marketshare every year.

      Right now, only NBM (nothing but Microsoft) users and legacy systems run IIS. It doesn't offer anything valuable, except customer lock-in. (which is very valuable, but only for Microsoft)

      • by G-funk ( 22712 )
        Open Source (Apache and PHP) is the standard in the webserver space already and is gaining more marketshare every year.

        Apache yes, in its varied forms. But PHP is far from the standard. It may be the standard for hobbyist sites, but most commercial sites run on ASP,Perl,JSP+Servlets, or something proprietry like Vignette. Althogh PHP can be made secure by a good admin, it's often (usually?) not.
      • by jonbrewer ( 11894 ) on Wednesday October 30, 2002 @12:48AM (#4562046) Homepage
        Right now, only NBM (nothing but Microsoft) users and legacy systems run IIS. It doesn't offer anything valuable, except customer lock-in. (which is very valuable, but only for Microsoft)

        There's no way you can back that statement up. Corporations generally have a few outward-facing web servers, and yes, these are most likely running apache, but the vast majority of Intranet web servers are still IIS. After that you'll see Lotus Domino and iPlanet, and then Apache.

        (This is from my experience with large corporations, though the IT rags such as Information Week and Network Computing back me up.)

        IIS is the standard for Intranet web servers for a reason - it's standard. It comes with every NT server. It's easy, and setup/administration hasn't changed in years. Any clown with knowledge of Windows can make it work, and it is stable and reliable.

        In the last 7.5 years I have administered just about every popular web server written (including NCSA HTTPd, WebStar, and IIS on NT 3.51 back in the day). Of all of them, I've found IIS the easiest to work with. Coupled with Win2k workstation on the desktop, it's almost fun to administer them with MMC and watch their behavior with PerfMon.

        The reason I deploy mainly IIS servers is that I can order a server from the IT department with a standard Win2k build and have secure applications (with access control) running on it within minutes of taking delivery of the box. Try that with a Solaris, Irix, or Linux box, I dare you. (Yes, I currently deploy and manage Apache on Solaris, Irix, and Linux, just not as often as IIS on NT/Win2k.)

        Sure Open Source has a place in corporate webservers. That place just isn't big, and won't be until Apache is easy to configure and integrates seamlessly with Windows NT security. When an idiot with an IT degree from the local community college can integrate Apache on Unix with a corporate network and can authenticate users and implement access controls without opening a book, then Open Source will have arrived in the corporation, and will start to eat into IIS market share of the Intranet. Until then, it'll be fringe, relegated to use on big systems with unix sysadmins doing the implementation.
  • by papasui ( 567265 ) on Tuesday October 29, 2002 @05:02PM (#4559371) Homepage
    I'm sure it must be easier to find someone who knows PHP then it is to find someone who does cgi-bin c/c++ to maintain their sites. We use PHP/Asp for many of our internal applications we use for monitoring network systems and integrate it with MySQL. Works very well.
    • Question (not a troll, though sounds like one) - how was the decision made to use MySQL? I can't for the life of me figure out why so many people pick it for web apps.

      to trigger happy mods - again, not a troll, I'm curious.

      • by dimator ( 71399 ) on Tuesday October 29, 2002 @05:27PM (#4559591) Homepage Journal
        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.

        • I'm not trying to get anyone to convert, and you don't even have to beg me in capital letters to spare you anything.

          I'm simply curious - for most jobs that MySQL is used for, there are better free databases (sometimes not by much, but that's not the point), yet MySQL seems to be the only free RDBMS anyone's ever heard of. I am trying to picture why, and asking people involved (it seems like) with the decision process in a company actually using it, seems like a good way to find out, no?

          • by leviramsey ( 248057 ) on Tuesday October 29, 2002 @07:01PM (#4560152) Journal

            MySQL is faster in really only one particular case: lots of SELECTs with few UPDATE/INSERT/DELETEs. Many applications have orders of magnitude more SELECTs than other queries (I'd guesstimate that Slashdot books at least two orders of magnitude more SELECTs). Nothing beats MySQL in that environment, and there are a lot of apps where that's all that's needed (think CMS's and other such things).

      • I use it because its free, postgres isn't quite as well integrated with php, and i dont need the extra features of a more complete SQL engine for what I do anyhow (no transacts for example). Plus the documentation for MySQL is great, because there are so many users.
      • I am a huge PostgreSQL fan myself, but for mostly-read databases (like most web databases) MySQL is hard to beat.

      • For me, MySQL is more cross-platform than Postgres. I develop on Windows/Linux at work, Linux at home, and then copy it to a Linux server. Postgres doesn't have good Windows support.
  • by FortKnox ( 169099 ) on Tuesday October 29, 2002 @05:02PM (#4559372) Homepage Journal
    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??
    • It'd be interesting to see Yahoo!'s stats - whether they get a performance/speed/efficiency boost from PHP, how it compares to the old system, etc.

      As a PHP coder, this makes my heart fill with joy... should be much easier to convince PHB's to let me do it in PHP!!! :-D
      • whether they get a performance/speed/efficiency boost from PHP

        PHP, even with mod_php, isn't going to give any type of boost over a proprietary C/C++ app other than maintainability. The reason I butted in suggesting J2EE was the easy clustering, database pooling, and data caching that goes above and beyond what mod_php can do.
      • by sporty ( 27564 ) on Tuesday October 29, 2002 @05:17PM (#4559508) Homepage
        Ug, as a prior php developer, who worked on enterprise level apps, i'd pray for them. PHP has it's unique problems once you have a large code base. You are more likely to require two modules in php that won't play well toegether or get errors in php itself. Php didn't like gnome-xml and ssl together at one point for example. I've had includes just die randomly when the include_once tree got too large. It'd die on a variable assignment.. strange shit.
    • by photon317 ( 208409 ) on Tuesday October 29, 2002 @05:09PM (#4559439)

      Eep, why J2EE? It's slow, it's a memory hog, it doesn't deliver on the write-once-run-anywhere promise of Java because of the vendors' differences. Perhaps most importantly for them, you really can't use Java w/o threads, and thread support on FreeBSD is not great. Read that over again. That means that Java doesn't scale well for you if your OS's thread don't scale well for you. If you're running FreeBSD, then that's the case, which further limits Java's absymal performance.
      • So instead of fixing FreeBSD's threading, you advocate not using threads?

      • by jallen02 ( 124384 ) on Tuesday October 29, 2002 @06:13PM (#4559734) Homepage Journal
        You care to back up any of the claims your making? I have seen J2EE in production environments deployed with great success. There is nothing inherently slow about J2EE in general. "Java's abysmal performance"? In what context is Java's performance abysmal. I won't contest that for a number of tasks it is not optimal, for server application programming tasks it really shines.

        I just don't buy outright arguments like that at face value. It is *NOT* well understood or believed that what you state is true among any large groups of professional developers with proven experience deploying J2EE apps. Proof please.

        Trust me, I love PHP. I wrote a book on PHP and think it can do great things.. but for enterprise level applications and for quite a few tasks it just isn't there.

        Jeremy
      • by lateefj ( 412468 ) <lateef.jackson@g[ ]l.com ['mai' in gap]> on Tuesday October 29, 2002 @06:35PM (#4559945)
        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).
      • by Pengo ( 28814 ) on Tuesday October 29, 2002 @08:56PM (#4560962) Journal

        All the slow EJB installs I have seen have the following problems:

        Use of remote classes where local ones would make sense. Use a session bean to aggrigate the results of a few beans and send out the result you need.

        Bad database design or just poor JAVA programming.

        I have studied EJB extensivly , and can usually get near database-query speed if I think hard enough about what I need. I have read that remote objects should only access session beans, and this is a pretty good idea for the most part.. Your calls should be fewer and pull down the data it needs rather than make LOTS and LOTS of calls...

        Anyway, it's a pretty elegent solution and really forces you to think about design. Solutions such as Caucho's Resin CMP makes it even easier to use an EJB solution for object-relational managment and , with resin imparticuarly is easier than using a roll-your-own JDBC based code.

      • by the eric conspiracy ( 20178 ) on Tuesday October 29, 2002 @08:58PM (#4560982)
        It's slow, it's a memory hog,

        Nonsense. J2EE's threaded model is far more effecient than Apache/PHP's process per connection model because of the memory sharing. In terms of speed, App servers like Resin

        http://www.caucho.com/articles/benchmark.xtp

        do just fine against PHP in terms of speed.

        it doesn't deliver on the write-once-run-anywhere promise of Java because of the vendors' difference

        True a few years ago before Sun started validating app servers. Now not so true. The ServerSide.com runs on a cluster of machines where each machine runs the same code base on a different vendor's app server.

        What I want to know is how come no PHP advocate mentions scalability? How do you pool arbitrary objects, or cache static data in PHP? How do you distribute sessions in PHP????? What happens when you want to cluster that PHP site??

      • Hm, I'll write off the "it's slow" comments to you not knowing what you are talking about - this is very obviously very false (especially for web apps)

        I just wanted to comment on the write-once-run-anywhere thing. I develop code on Linux and Windows with Tomcat and JBoss, the code is deployed in production on Solaris and Tru64 with Weblogic (in addition to the former), and I don't have to change a line of code to go between them - that's good enough for me.

        Anyway, if you claim Java's performance is abysmal (in any area except 3D graphics) you just haven't looked at the damn thing in a few years.

      • by photon317 ( 208409 ) on Tuesday October 29, 2002 @10:43PM (#4561501)

        1) I see Java-lovers have knocked me down -2 overrated so it's back down to 3. Way to squelch opposing opinion there.

        2) To ALL the repliers here: I know exactly what I'm talking about. I have coded expertly and will continue to do so in everything from x86 asm to C to C++ to Java to Perl to ..... enough to know. I have written enterprise-class multi-platform java software with 100,000 users and a terabyte database behind it. I've written dos .com program using "copy con" and the numeric keypad, and everything else inbetween. I'm here to tell you, Java is a fucking pig, and you need to realize it. Don't fool yourself with propoganda just because Java is your life and income.
    • by Vaulter ( 15500 ) on Tuesday October 29, 2002 @05:11PM (#4559450)

      Because Yahoo is one of the fastest sites on the 'net.

      EJB's are great, don't get me wrong. They are great for handling database abstractions with zero tolerance for errors. But they are not fast, and horrible overkill for a site like Yahoo. All that abstraction and IIOP communication kills performance. Which is why shops that have large EJB applications tend to run them on heavy duty sun hardware. Not i386 boxes running FreeBSD.

    • by glwtta ( 532858 ) on Tuesday October 29, 2002 @05:12PM (#4559454) Homepage
      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.

  • gezlawez (Score:3, Funny)

    by gritz ( 527004 ) on Tuesday October 29, 2002 @05:04PM (#4559392) Journal
    seems that any 'ole yahoo can do php nowdayz
  • Jeez (Score:3, Insightful)

    by wizarddc ( 105860 ) on Tuesday October 29, 2002 @05:04PM (#4559393) Homepage Journal
    I guess I don't know how much work is involved, but Yahoo seems like it would be a giant messH^H^H^H^H venture to convert from one scripting language to another. And is this just gonna be for some sections, like the directory, or the user login stuff, or the auctions? Seems like a whole lotta work.
  • by Anonymous Coward on Tuesday October 29, 2002 @05:05PM (#4559401)
    Yahoo is using the great Ioncube PHP Accelerator [php-accelerator.co.uk]. It's really quite amazing, and free (but not open source).
  • by Anonymous Coward on Tuesday October 29, 2002 @05:07PM (#4559413)
    I find it very funny that some people are posting comments suggesting there are security problems with PHP.

    PHP has had a few security problems but they have all been fixed very quickly, just like many other open source projects like FreeBSD and Linux.

    I find it very amusing the Perl programmers are shocked that Yahoo picked PHP instead of Perl. Perl has its uses but it is not designed for the web, PHP is.

    PHP is easy to learn, powerful and c-like which makes it good for rapid development and web based applications.

    I would have been very shocked if they picked Perl of PHP, in my experience PHP is faster, more secure, more feature rich, way easier to compile and maintain, and takes far less code to accomplish the same things as Perl.

    If you look at hotscripts.com you will notice PHP has more entries than Perl, this has only been the case for the last few months and though it is a small indicator it is obvious PHP is gaining popularity and it is well know it is the most installed apache module on the Internet.

    Furthermore if you don't code for PHP don't comment on it, you don't know what you are talking about.
    • by Anonymous Coward on Tuesday October 29, 2002 @05:13PM (#4559464)
      PHP's biggest security problem is it's users. PHP is a powerful and easy to learn and use tool, which means it attracts a lot of new users. And the more new users you have, the more new user mistakes are made.

      PHP has made a grep step forward in disabling register_globals by default. Unfortunately, a lot of legacy code isn't built for this.
    • Perl has its uses but it is not designed for the web, PHP is.

      That sentence is as much hogwash as what you are so upset about. Perl itself certainly wasn't "designed for the web", but mod_perl was, CGI.pm was, check out CPAN under HTML::, HTTP::, Apache::, etc - all of that was designed for the web.

      Oh, and since PHP was designed for the web, that means it wasn't designed for (let's say) database access, does that mean DBI is better?

      Anyway, this "designed" bit doesn't really mean much usually, it's what it actually "can do" that counts.

      btw, I just can't agree on a few points in one of your sentences:

      in my experience PHP is faster - your experience is different from that of many other people.

      more secure - this is entirely up to the developer, any differences the languages themselves may have in this ragard are utterly isignificant in comparison to the idiotic things that people routinely do.

      more feature rich - Perl has been around pretty much since the middle ages (give or take), the quantity, diversity and (sometimes more importantly) maturity and quality of modules and other various extensions that's available for it cannot be matched by any other language; not to mention the organization of said material.

      way easier to compile and maintain - I am not sure if you are talking about the language itself or scripts written in it (as the former doesn't matter a lick, and the latter... well I don't see anyone having trouble compiling Perl or PHP scripts).

      If you look at hotscripts.com you will notice PHP has more entries than Perl - I was intrigued and did look at that site. Perl has insiginifcantly more "Scripts and Programs" and PHP makes up for it by having roughly 4 times as many entries in "Tips and Tutorials", why is that one wonders? Quick search at www.oreilly.com - 15 books for PHP, 730 for Perl; sure most of those have nothing to do with web development, but still (for comparison sake, same thing at Amazon.com - 73 to 354).

      I know I'm just propagating a stupid flamewar, but what are you going to do?

      Furthermore if you don't code for PHP don't comment on it, you don't know what you are talking about. - Lastly, I just wanted to find out if you code in Perl?

  • by Waab ( 620192 ) on Tuesday October 29, 2002 @05:07PM (#4559419) Homepage
    As long as the change doesn't cause me to lose the lead in my fantasy hockey league, Yahoo can do whatever it pleases.

    And, if I do happen to lose the lead in my fantasy hockey league, I now have something to blame it on.
  • makes sense... (Score:5, Informative)

    by Anonymous Coward on Tuesday October 29, 2002 @05:08PM (#4559431)
    ...considering it's initial creator [advogato.com] is now a Yahoo! employee
  • by nick-less ( 307628 ) on Tuesday October 29, 2002 @05:09PM (#4559437)
    yahoo will need more E10000's soon ;-)
    • I know you're being funny, but Yahoo runs on FreeBSD.

      In fact one of the reasons they didn't use Java instead of PHP is that Java on FreeBSD isn't up to par.

      So it's time to invest in Walnut Creek... no wait it's BSDI... no wait it's WindRiver... oh damn it! I give up.
      *BSD is dying...

  • Hot dog! (Score:3, Insightful)

    by mao che minh ( 611166 ) on Tuesday October 29, 2002 @05:10PM (#4559449) Journal
    I love hearing about the implementation of an open source technology by a major web prescence, especially a technology that is as useful as PHP. But this has more implications, such as the inevitable increased awareness of mySQL (should this move peak the interest of other companies, which will cause them to look into this while PHP thing, and no doubt come across mySQL). PHP is linked strongly to mySQL: you can't pick up a PHP book without half of it being dedicated to the open source database.

    Happy days.

  • fascinating (Score:5, Interesting)

    by erikdotla ( 609033 ) on Tuesday October 29, 2002 @05:15PM (#4559483)
    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.
    • Re:fascinating (Score:3, Insightful)

      by 3am ( 314579 )
      TMTOWTDI (from my experience with PERL) is definitely a drawback for large scale projects, and the presentation mentioned that there are 600+ engineers there.

      I would imagine the Yahoo engineers spend much more time reading other peoples' code than writing new code, and that (IMO) is where PERL is worst. Complicated tasks can lead to some truly horrendous looking code and very non-standard code organization. While it is fun to write and powerful, it can be awful to figure out what some other developer is trying to accomplish unless they are very disciplined.

      I once inherited a 1000+ line script at a previous company for analyzing IIS logs, and it was pretty difficult to get up to speed compared with comparable tools I've worked on written in Java, C/C++, or VB.

      (That said, I like PERL and use it whenever appropriate.)
    • Re:fascinating (Score:4, Insightful)

      by pHDNgell ( 410691 ) on Tuesday October 29, 2002 @07:31PM (#4560420)

      3. One of the requirements was a language that didn't require a CS degree to use. TMTOWDI helps that, I've noticed.


      I have to disagree strongly here. TMTOWTDI generally means that two implementations of the same design are different enough that someone without a lot of experience probably wouldn't be able to tell that they were the same thing.

      Having standard ways to do things makes it a lot easier to understand what's going on and makes it a lot eaiser to do things. Even in perl, people try to find a common way to do things, and it often ends up being regular expressions, even where there are far easier solutions.

  • Why is PHP so bad? (Score:5, Insightful)

    by Anonvmous Coward ( 589068 ) on Tuesday October 29, 2002 @05:16PM (#4559497)
    I skimmed the comments so far and it seems like some people don't have a very high opinion of PHP. It's one thing to feel like something is better, but to despise it baffles me.

    I do programming in PHP and have found it not only to be useful, but quite an upgrade over ASP. Is there something inherently bad about PHP that should make me shy away from it, or is it more of a religious debate?

    • by watchful.babbler ( 621535 ) on Tuesday October 29, 2002 @05:25PM (#4559576) Homepage Journal
      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.

      • but I don't think any of us can make a strong argument against it, except that it's not a general-purpose language

        I personally don't think a "general purpose language" is possible, nor desirable. If you try to optimize for everything, then it will end up being optimized for nothing. There ain't no free lunch.

        Besides, you are going to activate LISP fans to start entering these kinds of debates, and you don't want to do that.
    • by asolipsist ( 106599 ) on Tuesday October 29, 2002 @06:16PM (#4559766)
      PHP is not 'so bad,' but there are reasons why you might not want to use it.
      Here are a list of reasons why PHP may be suboptimal for web publishing.

      1. Lack of seperation between content and logic. Embedded logic code inside presentation can lead to a bewildering jungle of death for anyone who tries to maintain the code. Also, repeated logic must be maintained across all pages, instead of changing it in one place. (this goes for all ASP, PHP, perl type scripts)

      2. Performance problems with interpreted languages

      3. Can't take advantage of OO goodness. php is a flat procedural-like language, you can't do the robust object modeling, or any of the other spiffy OO things you can do with c++, java, (maybe .net) etc.
      4. HTML lock in. Your code will forever live in HTML, if you want a different display format (unlikely) you're stuck. ie. what if you want to have a propriatary client instead of html on your plam, you have to rewrite all the logic.

      5. Fancy features availible in Java (maybe .net) first. Oracle Objects, native DB connectors, will probably be written for Java before anyone tries to implement them (if ever) in PHP. You might not need these features of a small site, so its not that big of a deal.

      Don't get me wrong, i think PHP is great for certain types of applications, but for large sites like yahoo, I think they'd be better off choosing something else (they wont use java because they claim FreeBSD has threading problems)

      These are mostly addressed in the linked Y! eng slides. I'd be interested in hearing others opinion on this topic.
      • by brunes69 ( 86786 ) <slashdot@keir[ ]ad.org ['ste' in gap]> on Tuesday October 29, 2002 @06:43PM (#4560006)

        Points #1 and #4 are totally off base. It is very simple to seperate presentation logic from processing logic in PHP. Don't diss the whole language just because 95% of people don't know how to use it properly. you can either go the simple route, and use a special Display class for all your displaying ( easy to modify, easy to swap out for a totally different page), or as I did, you can use PHP's XML/XSLT functionality to totally seperate your logic form display, but having all logic code return XML strings and only at the funal step transform them using XSL.

        As for your point $3, see my exmaple above. PHP has a nice OO clas structue, which is great once you've used it for awhile and being to understand how it is "OO Designed for Web Development", not "OO for Application Development", which are two different things.

    • by Grip3n ( 470031 ) on Tuesday October 29, 2002 @06:42PM (#4560004) Homepage
      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.
  • by heldlikesound ( 132717 ) on Tuesday October 29, 2002 @05:19PM (#4559522) Homepage
    Not that I give two rips about Yahoo, but I am glad to see PHP being embraced by companies that are considered "heavyweights" in the industry. It helps dispel the myth that ASP is the "industry standard" and paves the way for PHP / OS databases to be accepted or at least considered when beginning a project.


    It will be nice to go to a large corporate client that is looking for an enterprise solution (what the hell does that even mean) and say something like:
    "I'd reccomend using PHP and Postgres on the backend of the project, given Yahoo's recent success, I think the platform is powerful, sucure, and cost-effective."


    I realize that what Yahoo does in reality is irrelevant, but executives like to hear that kind of shit. Of course that assumes Yahoo can make it all work well, time will tell.

  • by ntr0py ( 205472 ) <lee@@@dashf...com> on Tuesday October 29, 2002 @05:20PM (#4559533) Homepage
    It should be pointed out that they have no plans of rewriting the entire site in PHP.

    Click on the "Early Adopters" section near the bottom:

    Most Y! properties integrating slowly
    - no plans to rewrite entire site

    So "Moving to PHP" could be a bit misleading.
  • by Inoshiro ( 71693 ) on Tuesday October 29, 2002 @05:26PM (#4559579) Homepage
    "The drawback of using a code in template system, is that your code and HTML output quickly become forever intertwined."

    You see, the funny part here is that I write PHP, and I do not intermingle my XHTML and PHP at all.

    How does it work? Very simply! Your request handler parses the request, reads in any cookies, sets and changes, reads in the template from disk or cache, fills in the new variables, and pushes it to the client.

    Look, mah, no PHP/XHTML mingling! You move from a "myFirstPHP" model of HTML with PHP shoved in, to a proper model of a complete HTML document produced in anything with %%variables%% strewn throughout which are replaced at runtime by the PHP engine. With this separation of application logic and appearance, you get all the benefits of PHP with all the benefits of a separate interface code level (.NET WebForms does something similar, and Perl can easily do this too).
  • look at sourceforge (Score:3, Interesting)

    by drugdealer ( 608193 ) on Tuesday October 29, 2002 @05:31PM (#4559618) Homepage
    Take a look at the top downloads at SourceForge [sourceforge.net]. What is the most downloaded server-side web application?

    For those of you too lazy to click the link, the answer (at the moment) is phpBB. #2 is Webmin (Perl), #3 is phpMyAdmin, and #4 is PHP-Nuke. (I'm not counting JBoss as #4 because JBoss is the server itself rather than a web app designed to run on a server).

    So, we have
    1) PHP
    2) Perl
    3) PHP
    4) PHP

    BTW You can get #1 and #4 bundled together as LiquidNuke [liquidmarkets.com].


  • by Anonymous Coward on Tuesday October 29, 2002 @05:35PM (#4559656)
    I work for Yahoo!.

    We chose PHP because our proprietary scripting language didn't give us any performance advantage anymore. PHP is a language with a lot of use and a large group of people in the workforce that know it. We wrote our proprietary solution at the time because nothing else could give us the performance that it could. Things have matured, and with accellerators such as Zend, PHP is a fit for us. There are many more reasons outlined in the presentation. Read it.

    Some people here appear *angry* that we didn't choose [their favorite language] and all I can say to you people is "grow up." PHP is a fit for us. Your solution is a fit for you. Get over it. We know *quite well* how to run enterprise sites, and the decision to go with PHP was not made by the clueless.

    Yes, we use PHP. We use Perl. We use Python. We use TCL. We use C/C++. We use Java. We use Apache. We use FreeBSD. We use Solaris. We use Windows. We use Linux. We use GCC. We use GPL software. We use BSD software. We use proprietary software. We use a lot of things. This isn't really news.
  • by DarkHelmet ( 120004 ) <<ten.elcychtneves> <ta> <kram>> on Tuesday October 29, 2002 @06:08PM (#4559684) Homepage
    If Yahoo can do it, why can't slashdot?
  • by cr@ckwhore ( 165454 ) on Tuesday October 29, 2002 @06:30PM (#4559899) Homepage
    I read their presentation, and its good. They make a good case for PHP, and I believe PHP is well suited for the task. However, I have to disagree with one of the slides.

    Looking at the "Coding PHP Takes Discipline" slide, they make a point that "The drawback of using a code in template system, is that your code and HTML output quickly become forever intertwined"

    Well, I disagree captain! PHP can be coded in many different styles. Coding PHP directly into your HTML files is common, but a really poor way of doing things. In fact, there is a better coding style.

    I do a lot of development with PHP. In almost everything I do, I separate the code from the output, meaning that the HTML takes the form of a template, and contains no PHP. The PHP scripts perform all data processing, and then pass the data through an abstracted interface to a templating system. Whatever the templating system does with the output is beyond the scope of the PHP scripts themselves.

    This is a similiar principle as ODBC... database is abstracted from the code.

    For example, yahoo's new scripts could pass the processed data into XSLT transforms, then out through any other page display mechanisms they choose.

    I do have to give credit to them however, because they did mention using "smarty". For those that don't know, smarty is a popular PHP templating system, one of many. But it seems like their mention of Smarty is more of an afterthought, than the attention they gave to discussion their dicipline in coding PHP inline with the HTML.

    To make this point short, PHP is far more capable than the inline style of coding that a few PHP developers use. In fact, that stems from PHP's old school days. Now that the product is extremely mature, the code can stand completely by itself. Since PHP has C/c++ style semantics, and contains most standard ANSI C functions, converting their existing codebase ought to be a rather boring task. I hope Yahoo! takes a serious look at the fundamentals of engineering their new system.

  • by Mustang Matt ( 133426 ) on Tuesday October 29, 2002 @06:34PM (#4559935)
    I'm honestly surprised they've survived this long.
  • by doomdog ( 541990 ) on Tuesday October 29, 2002 @07:07PM (#4560196)

    According to the slides, the only negative thing they had to say about Java (J2EE / JSP / etc.) is that FreeBSD has really lousy thread support (and proper J2EE solutions require threading)...

    To me, that seems like a really stupid, short-sighted way to approach the problem. If Java is the best solution for them (which I think it would be), then why not move to an operating system that properly supports it?

    Why hamstring yourself to an inferior solution just because you don't want to give up FreeBSD? That's like complaining that your Pinto is too slow -- but you'd rather fill it with Premium gas to get a little performance boost instead of getting a better car.

    And what's up with 4500 servers? What a nightmare! Who in their right mind would want to deploy and manage 4500 servers? If they were really serious about this, they'd upgrade to a couple dozen big-iron IBM mainframes (like one of these! [ibm.com]), where it can run hundreds of virtual Linux instances (if needed)...

    I guess it goes back to the old saying "When you only have a hammer, everything looks like a nail"...


    • by Anonymous Coward

      Let's see, web development is a) parsing strings, and b) concatenating them. Which of these is Java good at? Well, neither. For the former, nothing beats a language with built-in regular expressions. Yes, I've used the ORO library from the Apache Foundation. Yes, it's a solid implementation of Perl 5 regexes -- but it's implemented in Java (slooooowww), and it's a pain in the ass to escape everything twice, once because it's a Java string literal and again because it's a regular expression. And even aside from those two problems, compare the following snippets:

      String foo = "bar"; Perl5Util re = new Perl5Util(); if ( re.match( "/\\s*b\\+z/", foo ) ) foo = re.substitute( "/[ \\t]+/g", foo );

      ...and in Perl:

      my $foo = 'bar'; $foo =~ s/\s+//g if ( $foo =~ /\s*b\+z/ );

      Cleaner, tidier, more readable, and the Perl will execute in one-fifth of the time. I got stuck working on a large project with JSP, and we ended up pushing a lot of stuff out into Perl scripts because working with strings in Java is so slow. I'm not talking about small improvements; I'm talking about "when we did this in Java, the user thought the server had hung, but now the user doesn't notice the wait".

      And I HATE Perl. But after using Java, I hate Java more. The only thing Java's got that Perl ain't got is OOP features. No, Perl has no OOP features. They have a hilariously ill-conceived imitation that's such a pain in the ass to use that the tutorial says "most Perl programmers will never define a class; only wizards do that". Yeah, well, in any well-designed language (or even a lame but rational one like Java), defining a class is trivial. If you fuck up a feature so badly that only "wizards" have the patience to learn it, yeah, sure, only wizards will use it. That just proves that the language designer is a fool. Frankly, I doubt very much that Larry Wall or anybody else involved in the design of Perl 5 had a firm grasp on what OOP is about, what it's for, and why people use it. It's like asking an Eskimo to design a garage. Go ask an Eskimo to design and igloo, and you'll get one hell of a solid igloo (as Perl is one hell of a procedural quick'n'dirty-text-processing language), but when you want a garage, hire an architect who owns a house that has one, and keeps his car in it, too. Common sense.

      PHP's not Perl, though. I'm not thrilled with it as a language. I hate Microsoft even more than Larry Wall, but ASP with JavaScript is not a bad way to do web pages (JS is less text-friendly than Perl, but far, far more so than Java, and it's vastly better suited than Java to the kind of quick development these Yahoo! guys are talking about wanting; it's got proper closures (better closure implementation than Perl, by far) and a clean, simple, and powerful OOP implementation -- you can define new classes pretty much on the fly. JS is a very expressive and pleasing language to write code in, and any halfassed JS interpreter will be at least somewhat faster than even the best JVM). ASP.NET (so-called) apparently has FINALLY, after YEARS of cluelessness, learned from JSP and started including some of the cool architecture that JSP has (letting pages inherit stuff from a parent class, for example, which is real nice in a large project; there's also other modularization goodies) -- but now you don't have to wade through Java shit to use it. Too bad it's a Microsoft product. But you take it as it comes, eh?


      Oh, and those 4,500 servers? Much lower TCO than those Big Iron dinosaurs. Furthermore, they can be replaced gradually and (once again) cheaply. You don't need it all happening in the one box, because it's a million separate Apache processes spitting out little HTML pages to a million different clients. Centralizing that buys you nothing. No one Apache process has to give a damn about any other.

  • Big Mistake (Score:5, Funny)

    by Pinball Wizard ( 161942 ) on Tuesday October 29, 2002 @07:36PM (#4560475) Homepage Journal
    Clearly, they should have used Cobol.NET [computerworld.com].
  • by AxelTorvalds ( 544851 ) on Tuesday October 29, 2002 @07:42PM (#4560521)
    This is interesting news. Very interesting. I'm not a web developer, I'm a bit twiddler. I've been trying to work on that area simply so I can do more, it's fun to learn and as a consultant you need to be able to do that stuff for clients from time to time.

    I've mostly explored JSP, Zope, and PHP. JSP is cool, tons of support, it feels like and acts like it's the enterprise solution. As such, it's a logical choice for a lot of things because if you need a hammer it's nice to have a sledge hammer. The reality, at least as I've seen it, is it's a bitch. It's huge, it's slow, it takes a super computer to really run, I've seen a fair share of sloppy JSP. It's cool, has all the gizmos that java has and it also has all the gizmos that java has. It seems like you need a ton of crap to build a lot of java stuff, even things from Sun like the JMAPI need 3 or 4 30MB downloads before you can build them and get them working, maybe that's just me complaining though. I'm also not sure what kind of vibe I get about Sun and java as a whole technology any more, I'm not saying it's going away or anything like that but it's not the goose that laid the golden egg anymore either. I don't know I'd tie my cart to java if my cart was as big a yahoo! Again, just my opinions, my C++ and assembly (of all things) skills have taken me farther the last couple years and got me jobs when there weren't any, java has just filled out the resume. While I'm knocking one of the most popular platforms out there let me also throw out the java developer base issue. Java was like a dot.com programming language, in no time it instantly had a huge developer base; how quickly do you think they'll run to the next great thing when/if it happens? I've wondered what would happen if sun started charging for the JDK. Or if .Net 2.0 really rocks and mono takes off.

    Zope. What to say about it. It's the bomb. It's also Python which is huge and on the cusp of going really huge, but hasn't yet. It's its own custom thing. It has a ton of cool parts you can drop in to it. It's probably my favorite. It is also a pain in the ass going to zope.org downloading something and trying to get it to work. It's like they have their own little sourceforget.net running in zope space and it makes the number of available parts look bigger than it really is. It's getting better but there is a lot of dead stuff on there. It also won't drop in to Apache that easily, you usually use their custom server and transport layer. It's not so bad but it's nice to be on mainstreet; it's more trustworthy. Other than that, it rocks, it's just a bit tough to sell it to someone who knows some of the buzz. If it were all up to me Zope would be the next big thing but it doesn't look like it's all up to me.

    Then I stumbled on to PHP and it kind of rocked my world when I first started screwing around with it. For simple kinds of web things, like dumping some tables out of a database or something it's kicks the hell out of anything else I've seen. It seems like a few lines of PHP and it's done. No magic web server/container, just the apache server on your redhat box.. Then some of the tools and kits that have been put together with it make it a much more compelling application platform. Zope really appeals to my aesthetic sense of software engineering, I like python, I like the structure and the object nature it just hasn't caught on like the wildfire I think it is. PHP is close to it in terms of pontential and reusable stuff and it's like the second coming of perl. There are still the stock issues, is it fast enough? can it scale? will it last? It seems like those answers are yes. Can it scale better than JSP? I bet for a shop like yahoo! there isn't a comparison; I bet PHP wins unless they triple the amount of RAM that they have or switch off of FreeBSD boxes to S/390s or Sun "Enterprise servers." Also, PHP has such a grass roots following and has really grown up slowly compared to java, I don't see a lot of PHPers really dumping it anytime soon as it is. Now that Yahoo! is involved, PHP may go up to that next level.

  • by bartash ( 93498 ) on Tuesday October 29, 2002 @08:02PM (#4560625)
    http://public.yahoo.com/~radwin/talks/yahoo-phpcon 2002.pdf
  • Maybe so (Score:3, Informative)

    by madenosine ( 199677 ) on Tuesday October 29, 2002 @08:26PM (#4560791)
    but does it change the fact that they read my e-mail and log my every move?
  • by Deven ( 13090 ) <deven@ties.org> on Tuesday October 29, 2002 @10:19PM (#4561373) Homepage
    The reasons given for "Why Not Perl?" were:
    • There's More Than One Way To Do It - This is a feature, not a flaw! Perl is much more flexible and powerful than PHP. Maintainability comes from coding standards, not language limitations.
    • poor sandboxing, easy to screw up server - Perl can create sandboxes with the Safe module... (And if there's any rough edges, Yahoo's engineers could probably handle it.)
    • wasn't designed as web scripting language - So what?? With mod_perl and HTML::Mason or TT2, Perl fits this niche well, without PHP's predisposition towards mixing code and data.
    These excuses for not using Perl are hardly compelling; they sound like rationalizations. Perl is a more natural fit for Yahoo's needs, especially considering that they already have 3 million lines of Perl code.

    But they plowed ahead with PHP, and what did they learn?
    • very easy to get some pages up quickly - Expected, but Perl would have been nearly as easy, and probably much easier for their existing Perl programmers.
    • But mixed app/presentation problematic - PHP code and HTML forever intertwined - Surprise, surprise! This is exactly why PHP is inappropriate for enterprise applications. PHP encourages such shortsighted design. Beginners like it, but engineers should know better.
    • PHP != Perl - The "implement twice" problem - They knew that they had 3 million lines of Perl in the backend; why didn't they leverage it? This was avoidable.
    • PEAR != CPAN - repository smaller, less mature than CPAN - Again, this was a foreseeable problem.
    • Surprises for people used to coding Perl - It's not just that some semantics differ. Experienced Perl programmers forced to work in PHP have to live with the frustration of having to write ugly convoluted code for things that would be clear and simple in Perl. PHP 4 filled in many gaps, but it just doesn't work as well as Perl does. (I speak from experience here.)
    So let's see. Their problems with PHP basically boil down to the fact that it's not Perl. (Despite the claims of PHP advocates, it's just not an equivalent substitute.) Of course, any experienced Perl programmer familiar with PHP could see these issues coming from miles away. They rejected Perl as an option, claiming that it wouldn't be maintainable, then discovered the amount of discipline required for PHP -- would following good coding standards for Perl really have taken any more discipline?

    Perl was a natural fit for their needs, and the obvious choice. The entire presentation seems to be an exercise in rationalization, attempting to justify a poor strategic decision. They should have used Perl. (Even now, they should probably abandon PHP and use Perl instead, to save themselves from getting further entrenched into this bad decision...)

If you think nobody cares if you're alive, try missing a couple of car payments. -- Earl Wilson

Working...