6 ms·
One reason PHP is so popular, before 2005 there were four choices: Java --all frameworks sucked at the time (I had to work on struts, it was painful). .net
by ardit33 18y ago
One reason PHP is so popular, before 2005 there were four choices:
Java --all frameworks sucked at the time (I had to work on struts, it was painful).
.net --tied to MS world, and the first iterations sucked
php --it was quick and dirty and easy to get started
cgi,perl, python, C++ --required higher level of expertise, and they were hard
php, was the sensible choice for something quick, and the more "primitive" state of the web apps at the time, demanded less from the framework/language being used.
Right now there is much more choices, and Python (Django), and Ruby on Rails can be really quick to get started on, therefore php is loosing it's main advantage, yet Django and Ror are much more sophisticated and maintainable on the long run.
Even Java now has some nimbler frameworks (Wicket, Stripes etc.)
So, right now PHP is a very bad choice to do anything significant, as it lost its advantages over time, yet it is a mess to work with.
But, the main reason we still PHP used so much, is that a lot of sites were build before 2005, and a lot of web devs are used to it, so as a language it will keep its momentum, but at some point it will run out of steam.
It seems that even the newbies now prefer Ror over PHP.
- brlewis 18y agoCan you edit that to "there were four popular choices"? I wrote BRL, the sensible choice for something quick, based on Scheme, well before 2005.
- mrtron 18y agoNo offense intended, but BRL does not appear to be a popular choice. It may have existed, but so did other possibilities not mentioned too, the idea was to summarize what choices your average developer had. I would also add that a lot of people chose PHP because they had been working in it since the late 90s and needed a big improvement in order to justify changing.
- brlewis 18y agoRight, I'm saying it wasn't popular. It isn't that people tried BRL and decided its superiority in speed of development, speed of execution, security and learnability weren't big enough. It's that people didn't try it.
- davidw 18y agoTcl things have been around a long time too, like Rivet, which was faster than PHP, and utilized a much nicer language.
- STHayden 18y agoI also feel like asp was also super popular before php came around.
- ardit33 18y agoyes, until .net was released, then it was droped overnight by the developers (well, within a couple of years). I used it, while in school (around 2001) and remember doing anything with databases was a real pain. PHP felt like a step up.
- almost 18y agoWhen coming from ASP PHP was just amazing. Not that it doesn't suck, it just sucks so much less than ASP :p And there are still ASP developers around, I just recently worked with a company that still writes all their stuff (websites for paying customers!) in ASP
- gscott 18y ago"And there are still ASP developers around, I just recently worked with a company that still writes all their stuff (websites for paying customers!) in ASP" The company I work for has about 4000 customers on an application using ASP / SQL Server 2000. If it works and it does what people want, they really don't care or know even what language it is in.
- coglethorpe 18y ago> php --it was quick and dirty and easy to get started I think that's the key, right there. Sites go after quick and dirty solutions, then scale and perfect from there. It's that low barrier to entry that I think draws so many developers to PHP, in spite of its problems.
- mojuba 18y agoThere is one more reason PHP is popular, not mentioned often: PHP is an embedded language and is designed to work well with HTTP servers. When you first hear that, you say "ah, go embed any language, then write your mod_x for Apache, what's the problem with it?". The problem is that it's not that simple. PHP is "embeddable" specifically for markup languages by design, and it was also designed with Apache's modularity in mind (I supppose). Perhaps Perl could have been a good candidate too, but it missed the train by not shipping the embedding feature in default installations. Python, or any language that depends on newlines, sucks for embedding in markups. So, PHP wins the battle because it was created with HTML and HTTP in mind. Could have been better, much better, much-much-much better. Okay. But that doesn't matter for now :)
- pdubroy 18y agoYou should check out Mako, a templating system for Python. Embedding Python (or Python-like) code in HTML is not as bad as one might think.
- brlewis 18y agoPHP is "embeddable" specifically for markup languages by design Not it is not! No it is not! Sorry to yell, but you're touching on one of my biggest peeves. The syntax that embeds PHP in the SGML family of markup languages was simply tacked on to an arbitrary syntax that vaguely resembles C and Perl. It was never designed. I wrote a language that actually was designed to embed dynamic strings in static strings. It doesn't get ugly the way PHP does when you embed static strings within dynamic code within your outer static markup. It doesn't look anything like PHP.
- mojuba 18y agoWell, Bruce, perhaps ...The best way to think of BRL is as a Scheme interpreter with an alternative syntax for strings is where you should look for reasons of BRL's unpopularity, I think. Can you tell us please, what is really special about BRL other than it being "Scheme with square brackets"?
- 18y ago
- chaostheory 18y agoPHP is VB6 for the web - quick and dirty. though now with some good frameworks, it's no longer as dirty if a PHP developer is smart enough to use them
- kingkongrevenge 18y agoThe effective question is Why did PHP win over Perl for LAMP hosting? Java and .Net might as well have been on another planet. The answer is that mod_php was a lot easier for a hosting provider to set up for shared hosting than mod_perl. Still is. The target user for scalable Perl and Python frameworks still seems to be someone with root access.
- mikeryan 18y agoI think that's a bit true but I also have to believe that from a syntax perspective PHP has always been easier to use. That and all the libraries are pretty much built into php. you never had to deal with CPAN - it was either built into PHP's core or you lived without it (generally).
- mechanical_fish 18y agoThe Perl community was too unfocused on the web. Perl was, and is, a general-purpose language built as a replacement for sed, awk, and shell scripts and later retrofitted for the web. PHP was built for one task, which gives it a certain coherency that is a major strength, especially for newbs. You learn to build a web page with embedded PHP on page three of most tutorials. I don't remember the Camel book covering that at all. If it does I didn't notice -- too busy slogging through the regexps and the hash syntax and the insane special characters and the bizarre function-declaration syntax. And I fear that, in Perl, there is no standard way to do it. There are probably 75 standards, which is helpful, but not very helpful. If I visit any random web forum about PHP I am 97% likely to find a discussion of website development; if I visit a random Perl forum I'm just as likely to find sysadmins debating how to automate database backups, or a linguistics debate, or a game of Perl golf.
- kingkongrevenge 18y ago> The Perl community was too unfocused on the web. That's a fairly ridiculous claim. Perl CGI had all the momentum. It had plenty of forums. I repeat: PHP won because as the internet grew and compile-at-run CGI was no longer sufficiently scalable mod_php was more viable than mod_perl or fastcgi.
- nostrademons 18y ago> the main reason we still PHP used so much, is that a lot of sites were build before 2005 That's really it - look at the dates on the sites he mentions. Wikipedia - 2002. Digg - 2004. Wordpress - 2003. FaceBook - 2004. Flickr - 2004. The big hits of 2005 were YouTube (Python), Reddit (Python), and Twitter (Rails). Then there haven't really been many big hits since then - the ones I can think of with the most publicity are Pownce (Django), FriendFeed (Python), Justin.TV (Python), maybe Kongregate (Rails). So around 2005 there was a big shift away from PHP and towards Python/Ruby solutions. There was a similar shift around 2000-2002 from Perl to PHP - the big hits then were LiveJournal (1998, Perl), Del.icio.us (2002, Perl), Blogger (1999, dunno), HotOrNot (2000, dunno), Craigslist (1996, Perl), EBay (1996, Perl), and IMDB (1998 or so, Perl).