Live data from Hacker News

The Future of PHP

medium.com

51–60 of 66 posts

Re: The Future of PHP

#51
I'm hearing a lot of praise for PHP frameworks such as Laravel, but I'm not sure PHP should strive to become more like RoR and Node.js. Rather, PHP's unique selling point, for me anyway, is its use as embedded language in otherwise static HTML pages via SGMLish processing instructions (``), and I think there's nothing wrong with that even with the current preference towards Ajax and (micro)services. It's just that embedded PHP did such an incredibly poor job (like, not even an attempt) of preventing injection attacks despite SGML having very strong mechanisms for context-dependent escaping and markup validation. Which has given PHP its bad rep as a botnet/DDOS vector, and deservedly so since this has become a long-standing problem for PHP and non-PHP sites alike.

Re: The Future of PHP

#52
post #10

If effing C and COBOL are still around and Javascript somehow turned popular as a general purpose application language then PHP isn't going anywhere.

C is coming back. Seeing rust is rising and its interoperability with C is pretty nice.

JS is almost general purpose these day. Just a bit more push to optimizations on JS engines.

Re: The Future of PHP

#54
post #16

Earlier quoted context omitted.

>The only people who think PHP is dying is those who don’t use it. That is absolutely not true. I didn't care about PHP at all when I didn't use it. Then I got a job where I had to use it (and the management didn't want to hear about changing it), and I started slowly disliking it. Then I got out of that job and again mostly forgot about it and curretly don't really care what happens to it. Weird defences like yours…

So, given you "don't care what happens to PHP", I assume you don't give much heed to whether it's winning or dying. That's basically what @deanclatworthy is saying, so there is nothing to fight about. Cheers!

Without giving a hint on the market share of PHP in the future, I think it tells something about its attraction force.

I mean, I didn't coded much Ruby over the last months in professional projects, but I am still interested with its evolution because it was such a delight to use it with Rails.

Regarding PHP, well, I did some in the past, and my next professional project include to deal with a PHP code base. In the meantime, I didn't care to use it or look at how it was evolving, which is "as exciting as your toothbrush" innovations.

Re: The Future of PHP

#55
post #27

As far as prominent products, besides WordPress, Facebook, and Wikipedia, Slack and Mailchimp are (were?) also PHP. (I googled and apparently a prominent '-hub' site uses it too.) The PHP hate never made sense to me in the context of the rise of Node.js: * In PHP I've never accidentally combined 2 + 0.3 into 20.3 * I dislike the cowboy-ish over-use of ternary operators and short-circuiting by JS devs (random example…

Facebook forked PHP (Hack) and slack transitioned to hack (or is still in the process of). Mailchimp seems to be looking for Go programmers for backend work, so not sure that PHP is the major language of their stack anymore. So not the best examples.

Re: The Future of PHP

#56
post #49

Earlier quoted context omitted.

> * In PHP I've never accidentally combined 2 + 0.3 into 20.3 But PHP thankfully combines `md5("PHP") + 1` into 3. Sounds legit. I think Slack's own anecdote [1] is a better characterization of PHP nowadays. Hint: they don't disagree that PHP was (and to the lesser extent, still is) a terrible language. [1] https://slack.engineering/taking-php-seriously-cf7a60065329

Could someone please explain both the 2 + 0.3 and md5("PHP") + 1 thing?

Autocasting. Autocasting was a cool and newbie friendly idea in principle. It just turned out to cause such horrible bugs in real code that no sane person would still argue its merits.

It also leads to stupid notions of thruthiness (google Gary Bernhard's WAT talk) and bad junior dev behavior. I've seen a popularish PHP framework document the return value of a function al boolean, but the actual return value was the string "0". It wasn't even a by prduct of the implementation. They just explicitly used return "0" for no good reason.

Re: The Future of PHP

#57
post #23

Earlier quoted context omitted.

types? interfaces?

Types, sure. PHP 7 does those better than python, mainly due to the fact that the main implementation actually checks the types. Python seems to rely on 3rd party tools for that for some reason. Dunno if they're gonna change that or if they designed it like that. Interfaces, hmm. PHP took its whole OO almost directly from Java, which is an odd thing to do given how different the typing disciplines of Java and PHP are…

let's say that the only advantage of python over php are ML libraries but porting a library is far different job than creating an ecosystem

Re: The Future of PHP

#58
Like many I've worked in lots of languages over the years and enjoyed the benefits, challenges and quirks of each one. But when I want to get a web application idea up and running I almost always reach for Laravel. It's the cleanest and most feature-rich application framework I've come across. I don't really care that it's written in PHP. All I know is that it's rock solid and gives me tons of infrastructure built-in. (I should note, though, that for the past couple years I only use Laravel for the back-end, and Vue for the interface.)

Re: The Future of PHP

#59

Curious on how much of the 34% actually uses PHP >= 7. As long as there's legacy, PHP jobs are not going to run out for sure, that's a given. I wouldn't exactly mind carrying a project in PHP >= 7, but I wouldn't wish to get a job in PHP < 7 territory personally.

In May 2018 78% of Composer users were on PHP 7+. (Composer is the PHP package manager.) Source: https://seld.be/notes/php-versions-stats-2018-1-edition

Re: The Future of PHP

#60

Curious on how much of the 34% actually uses PHP >= 7. As long as there's legacy, PHP jobs are not going to run out for sure, that's a given. I wouldn't exactly mind carrying a project in PHP >= 7, but I wouldn't wish to get a job in PHP < 7 territory personally.

Looking at the WordPress statistics, about 60% of WordPress websites runs on 7.x. I can imagine for dedicated servers that run PHP frameworks, that percentage is higher.

https://wordpress.org/about/stats/

Post reply on HN