Live data from Hacker News

The Future of PHP

medium.com

41–50 of 66 posts

Re: The Future of PHP

#41
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…

I have being using PHP since it was call PHP - Personal Home Page. The best part of the PHP is the templating! It makes a lot more sense then Perl at the time. Now days templating can easily be replaced by EJS. Personally I wouldn't want to use any language that does not have closure and function as a first class citizen. It makes programming fun and productive. BTW, the 2 + 0.3 thing you are mentioning are all fixed…

> BTW, the 2 + 0.3 thing you are mentioning are all fixed by ES15 and ES6.

Meaning that they broke a lot of code when they did that.

Not that it matters that much, since it often impossible to build a JS codebase that is over a year old without major refactoring.

Re: The Future of PHP

#42

For me PHP is exactly like IE6, it completly shaped web programming as we know it, and will have a true resilience, before dying, inevitably (disclamer: I used PHP from 2000 to 2009 , then switched to rails on a daily bases).

You may want to take a look at Laravel.

And when you understood how it works you may want to try Symfony. Laravel also uses some of their libraries.

Re: The Future of PHP

#43
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…

> * 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

Re: The Future of PHP

#44
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…

I have being using PHP since it was call PHP - Personal Home Page. The best part of the PHP is the templating! It makes a lot more sense then Perl at the time. Now days templating can easily be replaced by EJS. Personally I wouldn't want to use any language that does not have closure and function as a first class citizen. It makes programming fun and productive. BTW, the 2 + 0.3 thing you are mentioning are all fixed…

> The best part of the PHP is the templating!

I've used PHP for about 15 years give or take, off and on. Before that I variously used Perl, ColdFusion or ASP for fairly routine Web services. Mostly I use PHP for straightforward CRUD work, for which it is very well suited. I'm currently using it for what is effectively a glorified CMS system. It's perfect for the task, I essentially never encounter something in PHP that causes me consequential problems within the lane that I'm using it. Although had they not dramatically boosted performance with the 7 releases, I might have opted for something else at this juncture.

Re: The Future of PHP

#45
post #15

Earlier quoted context omitted.

Like what features?

types? interfaces?

Python doesn't need interfaces because it's duck-typed. If by types you mean type-hints you can have em since 3.5. It's not as pretty as TS or even PHP with strict_types=1 (even though you can describe things that you can't in php) but it works. What Python has over PHP is strong typing, meta programming, data science and ML libraries. And from what i've seen better overall code quality if you pick random library from pypi compared to packagist

Re: The Future of PHP

#46
post #7

Earlier quoted context omitted.

Recently I was asked to help out with a PHP project for work, I made the switch to rails almost a decade ago & haven’t looked back since so I was excited to see how PHP felt. I was fairly impressed with how easy it was to jump back to PHP, the documentation is full of examples, there is composer for package management and it has a strong community who meets up regularly.

Exactly. Composer is key here. Pear just didn't work well as a third party bolt on. As a result monolithic frameworks such as Zend Framework were born, along with Blogs, come CMS come frameworks. And Rails clones. It's still hard to navigate the 3rd party landscape, but integration is so much easier. My main gripe with Php is editor support. Jumping around a code base is hard when you introduce slightly abstract clas…

> My main gripe with Php is editor support. Jumping around a code base is hard when you introduce slightly abstract class loading. The more 'typed' the language is, I guess makes editor help easier, with auto completion etc. But that is a disjoint or me.

If you are comfortable with IDEs, I strongly recommend PHPStorm. It is the one piece of software that I happily pay for each year. It increases my productivity and quality control to such degree that I wouldn't want to write PHP code without it.

> Editor support for functions is useful. I'm slightly embarassed still at the frequency of my manual lookups.

I've been writing PHP for 10 years now, and I still have to look up just about every function. I only recently discovered that PHPStorm supports displaying the PHP manual as you type, but that it is disabled by default.

Re: The Future of PHP

#47
post #17

No. As much as everybody likes to hate on PHP, it powers a lot of services that are used all around the world - and a lot of internal systems. With 7.3 it seems as though PHP has finally got to a point where it knows who it is and where it's going - don't get me wrong, it's paid my wage for the last 18 years - but it's also made it very easy to shoot myself in the foot. With frameworks like Laravel and Symfony about…

>With 7.3 it seems as though PHP has finally got to a point where it knows who it is and where it's going I've been reading a similar sentence for each version since 5.6. Is 2020 also gonna be the year of the Linux desktop?

> Is 2020 also gonna be the year of the Linux desktop?

Of course. Every year is the year of the Linux desktop! :D

Re: The Future of PHP

#48
post #11

No. As much as everybody likes to hate on PHP, it powers a lot of services that are used all around the world - and a lot of internal systems. With 7.3 it seems as though PHP has finally got to a point where it knows who it is and where it's going - don't get me wrong, it's paid my wage for the last 18 years - but it's also made it very easy to shoot myself in the foot. With frameworks like Laravel and Symfony about…

Even if php stopped being used in all new projects today, people are still hiring for cobol projects. The number of php projects now is orders of magnitude more than cobol in it's heyday. There are going to be plenty of php jobs for quite some time.

Probably true, but also COBOL usually encodes the business logic, which is much harder to throw away and rewrite from scratch, than any presentation layer written in PHP.

Re: The Future of PHP

#49
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…

> * 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?

Re: The Future of PHP

#50

It’s exhausting seeing these kinds of discussions. The only people who think PHP is dying is those who don’t use it. Besides the languages quirks, it’s incredibly productive and has a huge community of well engineered libraries for almost all mundane tasks. Theres great testing tools and general quality tool alike PHPStan. There’s an enormous pool of talent to hire from. I code mostly in node nowadays, not through ch…

It is the same story for C++ and Java and they aren't going to die.

The more popular a language gets, the more critics it receives. Partly happens because you will see more mistakes and bad quality code which also reveals bad design decisions in the language itself.

Some languages have more quirks, especially if they are older and tend to stay backward compatible.

Scala was known as a well-designed language (I believe still is) but as the community has grown, the number of complainers also has grown at the same speed. we learned people can write horrible code with implicit conversions.

But you need those critics to detect anti-patterns, and bad APIs and hopefully either the language itself or some libraries will fix it for everyone.

Post reply on HN