14 ms·
It's not a surprise at all. Firstly, PHP has always been around, WordPress based websites still have like 1/3 share of all existing websites. Secondly, in the
by otar 6y ago
It's not a surprise at all.
Firstly, PHP has always been around, WordPress based websites still have like 1/3 share of all existing websites.
Secondly, in the recent years it got a very mature language, got loads of improvements and performance optimizations. With PHP 8 being planned to be released by the end of this year, it will be another major step forward.
Thirdly, Laravel, Symfony and other open source stuff are awesome.
I think if PHP does a major comeback as a decent platform for development and somehow gets rid of the undeserved reputation, those PHP devs who stayed with PHP and didn't switch to RoR, Django, Node or other platforms will be winners, including me :)
- altdatathrow 6y ago> somehow gets rid of the undeserved reputation That reputation is a competitive edge for companies and people who embrace PHP. They get shit done for the business and grow revenue while the rest of the tech community is rewriting basic tooling for the 50th time in Rust on a Kubernetes-powered back-end with a React front-end powered by a GraphQL API layer.
- keanebean86 6y agoBut the new stack is 12% faster!!!!* *We didn't re-run benchmarks after fixing edge cases
- johnnycerberus 6y agoI understand what you are trying to say but Kubernetes and React complement services written in PHP, the former can deploy and orchestrate them while the latter offers an option for SPA apps written in PHP. Also, Rust when written where it should be written, can enhance PHP services that require fast and secure components. But yes, trying to replace what PHP is good at (serving content) with Rust is not really the best thing to do.
- chrisweekly 6y ago"SPA apps written in PHP" huh? that sounds like a contradiction in terms.
- johnnycerberus 6y agoYou can have a PHP server rendered page that can hold multiple SPAs written in React, imagine a portal like Liferay where each portlet is its own React app. Or imagine Steam shop that is using React for some of its components, like its new chat system which is a SPA integrated into Steam network. * Yes, I should have said "integrated" in PHP instead of "written".
- jagger27 6y agoDefinitely a weird thing given PHP’s heritage. Of course it’s totally possible to write JSON API endpoints in PHP.
- ratww 6y agoI understand the sentiment, but historically there has been a lot more web-framework churn in PHP compared to other languages. The “framework du jour” and the set of best practices have changed way more often in PHP than in any other language, perhaps as much as, or more than Javascript.
- hu3 6y ago> I understand the sentiment, but historically there has been a lot more web-framework churn in PHP compared to other languages. That has not been my experience. When I used to work with that tech stack, the major framework choice only ever had 3 options: Zend Framework, Symfony and Laravel. From what I hear Laravel is the industry leading and there's no sign of that changing. Sure there are other less popular frameworks just like in other languages. > The “framework du jour” and the set of best practices have changed way more often in PHP than in any other language, perhaps as much as, or more than Javascript. PHP have had a published standard specification for framework and component interoperability for long time now: https://www.php-fig.org/psr/ https://www.php-fig.org/psr/
- ratww 6y ago> That has not been my experience Sure, but this is not about personal experience, but rather about history. Maybe it just happened before your time? Also, please read my reply in context. Pretty much every other language that's similar in purpose and popularity is provenly more stable regarding framework popularity than PHP. Sure it feels great to bash Rust and Kubernetes or whatever like the GP poster did, but PHP suffered from the same problems until very recently, whereas Python, Ruby, Java and C# among others did not. Even Javascript has been historically more stable in the backend than PHP: it's been pretty much just Express from almost the beginning, and other contenders never reached much popularity.
- ptero 6y agoPHP allows folks without a strong background to solve some simple business problems which, in general, is a good thing. But once the project exceeds a certain complexity threshold (which I admit many business problems never do), this approach hits a wall: things break and fixing it breaks more things and it is an uphill battle to move in the right direction. Adding a significant new capability -- forget it. To make things worse, this cannot easily be fixed because the implementation is a hodge-podge of ideas and functions. You cannot find good architecture people who want to work in PHP to clean it. It cannot easily be re-architected because it captures a lot of business wisdom. And business people (rightly) suspect pitches for a new built-from-scratch solution: sure, it will be fast and maybe it will be reliable; but will it solve their problem? will employees need to be re-trained? etc.
- new_guy 6y agoThat's not the languages fault, it's the incompetence of the people trying to use it.
- ssalazar 6y agoAh, “you’re holding it wrong.” Good languages make it easy to build and maintain robust, scalable, and secure solutions to problems.
- altdatathrow 6y agoFacebook ($750B), Slack ($15B), and Etsy ($15B) would beg to differ. But whatever, your arrogant, gatekeeping and elitist mentality is primarily a roadblock for your own career growth.
- ptero 6y agoWow, chill. I do not know what part of my post you reacted to, but to clarify, I do not mean that professional software engineers working on PHP are unskilled. What I meant was that PHP and its frameworks allow business person to solve simple problems without hiring a good software developer. Which is OK in many cases, but when this fails to work, it fails hard in a way that is both painful and difficult to quickly address.
- Minor49er 6y agoComposer, Packagist, and PHPUnit are all excellent too.
- Zak 6y agoPHP earned its reputation. Whether the reputation earned by previous versions is relevant to the current version is a different question. I'm going to assume it's a decent modern language now, but what's the argument for using it instead of another mature dynamic language like Ruby or Python?
- coding_lobster 6y agoI have no metrics on this but I was under the impression that due to the size of the PHP community the package ecosystem specifically for web is probably larger. The community itself being larger is of course another plus as it means you're able to get easier access to the knowledge of others. Thirdly of course the shared hosting providers (by what I've seen in the past) usually support PHP almost always - this is not the case for either Ruby or Python.
- nicoburns 6y agoPerformance is also better than Ruby and Python. While providing comparable development experience / ease of use.
- antonf 6y ago> While providing comparable development experience / ease of use. I would argue with that. Part of my job is writing a lot of PHP currently (Hack actually, but they are very similar). Sometimes it's OK, but sometimes early PHP design decision to make code always appear working correctly and avoid raising user-visible errors really make me wish I was coding in another language. One of latest examples: when converting string to floating point number, sometimes you get 0.0 in case of parsing error, sometimes part of string is ignored.
- kilburn 6y agoYes, PHP has some warts, but so do ruby & javascript [1], python [2], and all other similar languages. The keyword to look for people explaining some of these warts is "wat" (popularized by the talk at [1] I think). [1] https://www.destroyallsoftware.com/talks/wat https://www.destroyallsoftware.com/talks/wat [2] https://github.com/cosmologicon/pywat https://github.com/cosmologicon/pywat
- chrisweekly 6y agoThe bad rep is totally deserved. PHP, for most of its existence, has been a profoundly bad language per se. That doesn't mean nobody's ever built anything valuable on top of it, and I fully understand that (much like also-justifiably-maligned JavaScript) it's evolved quite a bit. But the points made in this mid-2012 article are absolutely spot-on in describing precisely why PHP absolutely earned its reputation: https://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/ https://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/
- jstummbillig 6y agoYes, but 2012 is 8 years in the past. Do you know what else is 8 years in the past? Well, not Reacts first release because that happened only in 2013. That's how long 8 years are in web terms. At some point — and boy, are we long past that point — it feels old when gramps goes off about the woes of PHP4 because, oh, it feels like it's just been yesterday.
- uponcoffee 6y agoMost projects are from yesterday though. Maintaining or porting legacy php is the reality of most projects.
- bawolff 6y agoPhp4 is not yesterday so much as last decade. Most people talling about legacy php mean php5, which is much more sane than php4
- s0l1dsnak3123 6y agoThis is why PHP deserves it's reputation. The state of the language is one thing, the state of the ecosystem surrounding the language is another. Anecdotally speaking, the vast majority of PHP projects I've been exposed to have been horrific precisely because there's a laissez-faire or "get the job done at any cost" attitude to software development that's uniquely prevelant in these communities (this exists in all languages, but in my experience it's way worse and way more normalized within the PHP silo). The language improving will only be positive for new projects that are started today, or that have been maintained by dilligent and empathetic engineers. Often teams are not as united on this front as they should be. I think using almost any other comparable language in 2020 (Python 3, Go, Typescript) is a better solution than starting a new project in PHP these days. I suspect the real reason many still reach for PHP first is because it is "easy" and PHP developers are ostensibly cheap and easy to replace. It's a false economy.
- hda111 6y agoUndeserved? Not really. Tell me another programming language that needed 3 tries to introduce a MySQL escape function. The future is Elixir/Phoenix or maybe also Python/Django. But probably not the pile of unmaintainable Code PHP leads to.
- mgkimsal 6y ago> The future is ... Python/Django I don't normally do a 'ha ha' sort of post on things like this but... 'ha ha'. WTF? That's a future with one hell of a long past that has not even begun to take over a small subset of mindshare. Python/Django is not 'the future' for anyone except current Django/Python devs.
- xwdv 6y agoIf I must work with a bad language, I'd rather choose Javascript over PHP any day.
- megous 6y agoActually, I often choose PHP over JS, because it has a lot more included in the basic runtime. The stuff I'd have to manage the dependencies for personally in JS, I have access to right away in PHP. Things like email message header formatting/quoting, PDO/database access, curl (easy to underestimate curl, but it supports much more protocols than just HTTP), XML parsing, DOM, CSV parsing, .... A ton of small things that add up in the end to an easier experience, when throwing together some quick project. And all these functions are standard, documented, dependable (all of these are there since 2006 or so, when I started using PHP, at the very least), and don't involve having to pull anything from an internet over npm that can be abandoned at any time by the uploader.
- mrfusion 6y agoHow’s the Django job market these days?
- jrsj 6y agoI don't really see how PHP catching up to improvements that were made in other ecosystems suddenly makes it a better choice than it's competitor though. What is it actually better at? And as a developer, why should I bother with it when it probably has the lowest average salaries of any web technology AND isn't going to help me get shit done faster than several other tools that pay above average?
- closeparen 6y agoI’m not a PHP programmer but I used to be. It’s hard to overstate the simplicity of the deployment model. Your competitors will spend tens of thousands of person-hours chasing their tails around Docker, Kubernetes, AWS, Ansible/Puppet/Chef, etc. while you spend 15 seconds FTPing your source code around. LAMP stack achieved the “serverless” dream before many of today’s engineers were even born.
- mgkimsal 6y ago> Your competitors will spend tens of thousands of person-hours chasing their tails around Docker, Kubernetes There are people who use all that stuff to deploy PHP-based apps too, though. One doesn't preclude the other.
- megous 6y agoAlso ad hoc in-production debugging/observability is kinda easy. ssh to your server, add a log statement to code. Done. I can't do that with a node app by default without restarting it, killing all connections, etc.
- jrsj 6y agohow is that any easier than dropping a fat jar or a binary on a server? its not like building those is difficult
- sjy 6y agoAnalogous to the ‘serverless’ platforms, there are many companies selling shared PHP hosting, so you can just upload your code and expect it to work without worrying about security updates, service management, configuring TLS, etc.
- superasn 6y ago> Thirdly, Laravel, Symfony and other open source stuff are awesome. I think PHPs biggest feather in its cap is Composer. I can't even line a single script without it now. It really changed the usefulness of the language for me by many times.
- rbg246 6y agoComposer has changed my life as well, so incredibly powerful. I love the patches package that can be combined with it, allows me to patch contrib modules or Drupal core in a controlled and transparent manner. This alone has changed my developer life.
- fpoling 6y agoAs a maintainer of small Wordpress and PHP forum installations I tried to use PHP for system administration scripts to avoid extra dependencies. It worked at the end surprisingly good, but only after I wrote quite a few lines of glue code to get sane behavior from PHP. The biggest surprise was that on Linux one cannot call an external process directly. At least with PHP 7.0 one always has to use an intermediate shell and one has to use extra functions to escape strings safely. So yes, PHP works, but defaults are insane and to make things secure and robust one has to use extra libraries.
- megous 6y agohttps://www.php.net/manual/en/function.pcntl-exec.php https://www.php.net/manual/en/function.pcntl-exec.php
- mekster 6y agoChoosing a language isn't like trading. You don't win by sticking to one. You rather lose by not knowing the strong points of each without trying any others.
- ReptileMan 6y agoFor me the real php gem has always been Slim.
- ksec 6y ago>Thirdly, Laravel, Symfony and other open source stuff are awesome. Most people talk about PHP the language but not its surrounding ecosystem. Yes The language run time went through lots of improvement, proper JIT landing in PHP8. But That is like talking about Ruby on Web Development without talking about Rails. ( Like it or not Rails easily represent 80%+ of Ruby's Web usage ) Laravel took everything that is good on Rails and its surrounding Ecosystem, ( Auth, SearchKick etc ) and packed it together. And the productivity I saw from those using it as a whole were amazing. There are also a lot less ideology with Laravel. And try to provide decent usage in all usage scenario. Compare to Rails which is more of an DHH / Basecamp's framework. I mean if Elixir and Phoenix LiveView dont pick up some mainstream usage I did imagine PHP with LiveWire will be making a come back. I sometimes wonder if anyone had made something like CooffeScript, or Scala or some other language that runs on PHP run time with some sane syntax ( Excluding Hack )