Slashdot Mirror


PHP At 20: From Pet Project To Powerhouse

snydeq writes: Ben Ramsey provides a look at the rise of PHP, the one-time 'silly little project' that has transformed into a Web powerhouse, thanks to flexibility, pragmatism, and a vibrant community of Web devs. "Those early days speak volumes about PHP's impact on Web development. Back then, our options were limited when it came to server-side processing for Web apps. PHP stepped in to fill our need for a tool that would enable us to do dynamic things on the Web. That practical flexibility captured our imaginations, and PHP has since grown up with the Web. Now powering more than 80 percent of the Web, PHP has matured into a scripting language that is especially suited to solve the Web problem. Its unique pedigree tells a story of pragmatism over theory and problem solving over purity."

5 of 281 comments (clear)

  1. Why PHP Won by Anonymous Coward · · Score: 5, Informative

    Hello world in PHP:

    Hello world!

    No Bullshit Boilerplate (TM), no needing 5KLoC of code and configuration, no application server to babysit 24/7, no need for catalina+tomcat+jakarta+jre+struts+hibernate+Xmxwtfbbq16GB, just load one module and every single customer sharing the server can use it... No need to understand the CGI protocol, no need to understand the HTTP protocol, no need to understand HTML even.

    1. Re:Why PHP Won by Ksevio · · Score: 4, Informative

      But you wouldn't do it like that because you could just do:

      Today is <?=date("Y/m/d");?><br>

      A big part of the appeal of PHP was how it could be mixed in to HTML documents to make a mess of server side and client side code.

  2. Re:PHP is great by CastrTroy · · Score: 4, Informative

    PHP is a truly terrible language, with a truly terrible API. Just look at functions like implode, which can accept parameters in either order. Also (according to one commenter), imploding an array of booleans results in the "true" values being converted to 1, and the "false" values being converted to empty string. That's just a single function. Don't even get me started on mysql_escape_string vs. mysql_real_escape_string

    The only reason it's so popular is that for such a long time it was the only choice for server side languages on a shared hosting environment. Even now there aren't really any good alternatives. Shared hosts still don't allow things like Java,.Net, or Node.JS on the server side unless you are prepared to pay a premium. Many hosts don't even offer Ruby, or Python, even though they don't require a constantly running process.

    PHP started off as a toy project, and although a lot of work has been done to add functionality to make it useful, it still shows that it was lacking a lot of design considerations. Object Oriented capabilities and namespaces were tacked on later, and it really does feel tacked on, because only a very small part of the available libraries use object oriented features.

    --

    Anthropic principle: We see the universe the way it is because if it were different we would not be here to see it.
  3. Re:PHP is great by Anonymous Coward · · Score: 5, Informative

    thin shim between C libraries
    That is a great point. Since the Microsoft fanbois hate Linux, they hate PHP. PHP is basically a way to call C libraries. That is why the library naming conventions in PHP are so inconsistent. It's because PHP is exposing those libraries, with all of their individual quirks, to an easy to use scripting language.

    Where I work, we converted a C-based CGI program that was developed from 1994 until 2009. At peak, I think we had nine C developers working on it. It took us only six months with three PHP developers to write a good PHP replacement that called our C libraries. Now I have two new college grads that are very productive adding features to the web site whereas before, I had expensive C programmers each with more than ten years of experience that took dozens of times longer to complete tasks. PHP has cut our development overhead by probably 80%. Now the three remaining C programmers can work on interesting projects rather than on web pages. PHP has, and this is not an exaggeration, saved my company.

  4. Re: PHP is great by zenbi · · Score: 5, Informative

    Try using it. It's an alias to another function that requires an optional library that ... doesn't implement the function.

    What? HTTP redirects with the header() function have been simple and consistent the entire lifetime of the language. The function is not an alias and does not require an optional library as you claim. I especially like that it exposes the underlying HTTP headers of the protocol instead of wrapping the redirect into some type of hidden Response.Redirect() type function. This "lower level" makes understanding and debugging redirect problems much more obvious.