8 ms·
PHP isn't popular because it's easy, it's popular because for a long while it was the only viable language for developing web applications.
by biggestdecision 7y ago
PHP isn't popular because it's easy, it's popular because for a long while it was the only viable language for developing web applications.
- wvenable 7y agoIndeed. I think most developers don't understand how amazing PHP was compared to the competition and just how fast it acquired new features during those early years. It was a scripting engine with a such a thin layer of C that it could easily and quickly incorporate the huge number of open source C libraries that existed at the time.
- osrec 7y agoWhile your observation is true to some degree, I do remember ASP, Cold fusion, CGI and a few other more obscure technologies way back when. Perhaps I was quite late to the party though - I only started programming in 1999 (got a computer for my 11th birthday!) - so I'm not sure what it was like before then.
- javagram 7y agoASP and ColdFusion both required license fees at the time I believe (asp the Windows server license and CF of course the CF license) CGI just would run any type of script. Originally that was typically Perl but PHP surpassed Perl for a variety of reasons. PHP could be run either through CGI or through mod_php in Apache. There was also a mod_perl I believe and a few others but php is what web hosts typically installed in the early 2000s.
- im3w1l 7y agoWhy did php beat perl?
- horizone 7y agoPersonally, I switched from Perl to PHP around 2002 (I could be wrong with the year) as I wanted to move from flat file dbs to MySQL. I wouldn't say that it beat Perl, it was just made web development more accessible. I still wrote in Perl after that, but for server side scripting (processing, cleanup etc).
- tjpnz 7y agoEasy to write and easy to deploy. But that was a double edged sword.
- Kye 7y agoThe web. Making a typical language output HTML required a lot of hoop-jumping or inventing a web framework in a time before Django and Rails. PHP was its own web framework.
- klodolph 7y agoSomeone with better knowledge might step in here. From https://perl.apache.org/about/history.html https://perl.apache.org/about/history.html > "PHP was also around already, and was an embarrassing witness to Perl's greatest weakness for server-side programming: that embedding Perl was a pain. Although the hooks were there for embedding Perl, they were both undocumented and buggy. My other take on it is that PHP is like TypeScript, in that the path to adopting PHP from HTML is simple enough—just rename your HTML files with a .php suffix and you can add dynamic elements—or not. Just like how you can rename your JavaScript code with a .ts suffix and add types—or not. Personally, I remember writing a few Perl CGI scripts. But I ended up using PHP for any quick-and-dirty dynamic stuff.
- wvenable 7y agoPerl was just as inscrutable then as it is now.
- wvenable 7y ago> I do remember ASP, Cold fusion, CGI This is the competition that PHP was so much better than.
- Sir_Vival 7y agoI had a job 5 or 6 years ago where I needed to maintain/add to a website using ColdFusion. I actually kind of liked it, compared to PHP. That said I wasn't doing anything especially complex, which might have changed my mind.
- pjmlp 7y agoCGI yes, ASP certainly not.
- untog 7y agoASP required a license. That alone made PHP superior for many people.
- pjmlp 7y agoCheaper definitely, superior not.
- untog 7y agoWhy are the two separate? Of course you include cost when evaluating with option is superior.
- pjmlp 7y agoBecause to be superior, the tooling and libraries also have to be superior. PHP was only free beer with a clunky language and 3rd class DB support. MySQL couldn't hold a candle to real RDMS back then, versus what was available with ODBC connectors.
- 7y ago
- anthony_doan 7y ago> I think most developers don't understand how amazing PHP was compared to the competition and just how fast it acquired new features during those early years. The only competition in those early years was Perl iirc. I'm not entirely sure if PHP was fast at acquiring new features. PHP didn't have classes until version 4 iirc. Namespace in 5.4? And 5.x is around NodeJS early days where RoR and Python Django/Pylon/Pyramid was around. I think how easy it is to pick up the language to do things contributed to its success. The template is built-in and 1000 functions in the global namespace.
- jtreminio 7y agoProper classes in 5.0, "true" OOP in 5.2. Namespaces in 5.3 Javascript namespace/module handling is a nightmare, they should have copied PHP's.
- wvenable 7y ago> I'm not entirely sure if PHP was fast at acquiring new features. You really have turn back the clock; languages didn't have package management back then. They didn't have packages. The only exception, at the time, was Perl (which had CPAN). PHP acquiring features was not just about language features but also how quickly it's standard library grew to accomplish anything you needed on the web. > PHP didn't have classes until version 4 iirc. Namespace in 5.4? And 5.x is around NodeJS early days where RoR and Python Django/Pylon/Pyramid was around. I'm actually talking about the PHP3 era; by the time we're talking about PHP5 then there was already plenty of competition and the "early days" were already long over.
- javajosh 7y ago>for a long while [PHP] was the only viable language for developing web applications. That is not what I remember. CGI existed before PHP (1994), and was used extensively for web apps (ebay still appears to use it to this day). Also, mod_perl and Java Servlets were introduced around the same time, circa 1996, so I don't think it's correct to say PHP had a monopoly on web apps "for a long while".
- vezycash 7y agoColdfusion was also a thing around that time. Flash sites as well.
- deleted 7y ago[deleted]
- cutler 7y agoYes, Flash was huge. When I was learning Perl around 2000 I shared a flat with a Flash animator who worked for an agency with huge clients such as Sky. It was all done in Flash for very big dollars.
- toyg 7y agoNot a monopoly, but it was the easiest and most performant option at lower price points. Java required specialised or dedicated hosting ($$$). CGI was slow as hell. Mod_perl often was not available in shared hosting, for whatever reason. PHP was cheap, fast, ubiquitous, and Good Enough™, for about a decade. Then VPS happened and the market changed.
- vidarh 7y agoMost people initially deployed php via CGI in my experience. I don't remember when mod_php arrived, but we'd been using PHP for quite some time at that point. While CGI was slow-ish, alternatives like fastcgi were already around (and in fact running PHP via fastcgi was also quite common for a while. By the time PHP became ubiquitous, most people had moved away from plain CGI regardless of language.
- traverseda 7y agos/PHP/Javascript
- osrec 7y agoNot sure I agree with this. Here's why: new tech stacks crop up every few months, and they're all competing for the same developer brain space. If PHP wasn't easy, I'm certain the interest in it would have evaporated to a large extent. Yet even today, people are choosing to start their projects in PHP. I think it's simplicity has a lot to do with it.
- momokoko 7y agoBut PHP was essentially the original widely adopted lambda cloud function. 1,000s of dirt cheap shared hosting platforms showed up on the scene. The reason they could make the hosting so cheap was that the way PHP runs. You are only consuming resources when you are serving the request. To this day, cloud functions still deal with "cold starts", where this was already a solved problem with PHP shared hosting. All PHP needed to be was good enough. It was how it served pages that made it as popular as it was. Large disclaimer, I know a PHP shared host was not actually scalable like AWS Lambda. Just the idea that any small business could plop down a few servers and start selling shared PHP hosting was huge back then.
- h1d 7y agoIt's more like, would someone else be able to maintain the code I write with language X? And would the person trying to run it be able to run in their environment without fiddling with SSH access? If it's just me writing and deploying I use TypeScript but otherwise I tend to use PHP.
- cutler 7y agoTwo other big factors in PHP's popularity in the early 2000s were its inclusion in Dreamweaver as an option for building dynamic sites and the profusion of "Build X with PHP & MySQL" magazine articles.
- pjmlp 7y agoDelphi, C++, VB have been viable since 1995, Smalltalk since 1995, Objective-C since 1996, Python since 1998, Java has been viable since 2001, C# and VB.NET since 2002. PHP only became viable with version 3, around 1998, and having most ISP only offering a choice between CGI (usually C or Perl) and PHP, naturally drove most cost oriented devs to PHPs. Those willing to shell out more, could use one of the above options.
- buboard 7y agofor how long? Perl existed when php started, as well as all the proprietary languages, java , asp etc. then came ruby python etc. It's not for the lack of competition