5 ms·
> the performance of a historically technologically poor language like PHP One of the biggest reasons PHP supplanted Perl as the de facto web programming langu
by streptomycin 15y ago
> the performance of a historically technologically poor language like PHP
One of the biggest reasons PHP supplanted Perl as the de facto web programming language ~10 years ago was that Perl running through CGI was incredibly slower than PHP.
- rscale 15y agomod_perl also had serious performance and memory leak issues. PHP sucked at the time too, but it sucked in ways that were easier to track down and fix.
- dspillett 15y agoPerl had a reputation for being more complex for a beginner too and leading to code that was difficult to maintain.
- dmooney1 15y agoI always thought it was because basic PHP was so intuitive for anyone familiar with a C-like language.
- pbiggar 15y agoThere's a ton of reasons PHP took off, including off the top of my head - cruftyness of perl - good timing, few alternatives (C and Perl basically) at a key point in the growth of the internet and web developers. - very easy migration from a static only site - easy to deploy, leading to... - wide availability of PHP shared hosting - in depth docs - commenting on docs (cut-and-paste programming ;)) - thousands of builtin functions: first real batteries-included language - recognizable syntax (esp vs Perl) for Java/C programmers - not awful performance - builtin MySQL support from an early stage - oh, it was free (and also Free) - dynamic typing - weak typing (as in, values coerced to other types easily, I know this isn't a real term)
- nir 15y ago> - commenting on docs (cut-and-paste programming ;)) Very true and rarely mentioned. PHP docs never had the fancy wiki/social/javadoc features you see in many languages, just a primitive comments system - and it was perfect. When you were picking it up back when "PHP3" yielded 0 results in Amazon (and we had to change the oil on our desktops every week) the docs were your bible, not merely in the sense of occasionally contradicted themselves but also in having examples, Q&A and recipes for common tasks posted by your peers in the comments, much faster than doc writers could catch up with the language's growth.
- r00fus 15y ago> good timing, few alternatives (C and Perl basically) at a key point in the growth of the internet and web developers. Two web language competitors to add here: MS .ASP and ColdFusion. PHP broke out by being both free and Free (the REPL helped too).
- sciurus 15y agoAs an aside, there are an enormous number of ways to deploy a modern perl application. For anyone who is curious, see slides 30 through 79 of http://www.slideshare.net/miyagawa/deploying-plack-web-applications-oscon-2011-8706659 http://www.slideshare.net/miyagawa/deploying-plack-web-appli...
- themonk 15y agomod_perl was there, it performed better but little bit extra memory footprint. I don't know why mod_perl was known to very few and PHP become popular.
- rubashov 15y agoShared hosting services offered php. You can't do shared hosting with mod_perl.
- fallous 15y agoUmm, actually you can... it just requires some skills on the apache config side.
- fallous 15y agomod_perl required real programming techniques due to the shared namespace. So many cgi scripts were written with no localization and so many programmers of that era had embraced the sloppiness of lack-of-persistence that it was hard to port existing cgi to mod_perl even assuming they bothered to try and grok the "voodoo" of persistence in a single finite process CGI world.
- fallous 15y agoSorry, but that's just historically inaccurate. PHP _10_ years ago was popular because it was a templating language that could be embedded in HTML, in which case it supplanted SSI and really was a competitor to ASP. mod_perl was spanking PHP 10 years ago from a performance standpoint, but the democratization of the web meant that a lot of people that started with basic HTML layout then learned to extend it with PHP in templates, then moved on from there. Much the same as Perl became a dominant CGI language in mid/late 90s because a lot of sysadmins and hackers transitioned to back-end development due to web programming demands.
- streptomycin 15y agoNo, it's not historically inaccurate. mod_perl was fast, but no shared hosts offered it. So unless you wanted to shell out big bucks for a dedicated server, mod_perl wasn't much of an option. And if you wanted to write software to give away or sell to others, mod_perl certainly wasn't much of an option unless you wanted to only focus on a very small part of the market. I personally transitioned from writing Perl CGI scripts to writing PHP scripts about (pause while I look through my records) 9 years ago, and it was exclusively for performance reasons (I still prefer Perl as a language). I was not alone in my thinking back then.