Live data from Hacker News

A look at modern PHP

lwn.net

501–510 of 610 posts

Re: A look at modern PHP

#501
post #494

Earlier quoted context omitted.

I do not do PHP and only have done a bit a long time ago, but I chuckle at the statement that nobody starts any project in PHP, only to find that a huge amount of new sites are wordpress sites, and they are a gateway to PHP. And do not discard WordPress, because it is amazing in how you can have a productive web site with no programing knowledge. After your site actually generates value then you can hire programmers…

I was paid to build a Wordpress extension once. It was the most miserable programming experience of my life. Wordpress is no doubt a powerful force on the web. As a no-code website-creation environment, it's fine. Maybe even good. But as a library, it is godawful.

i haven't done wordpress in 5+ years but oh my god it had everything that's bad about php in it.

Re: A look at modern PHP

#502

Earlier quoted context omitted.

as a Ruby/Rails guy, I feel the same way. Seems like Rails became the top stack to shit on to feel better about your stack these days. People are just tribal. We need to feel superior to the "other" to feel better about ourselves.

Funny, I remember everyone hating on PHP when they moved to RoR, and now they hate that are and moving on. Its almost as if they just need things to hate so they can rewrite code. its very cyclical IMO. The elitism of learning a new language and then mocking those that haven't put in the same time and effort to row in the exact same direction, has always amused me. Ive never judged anyone for what tools they use to g…

Kinda like how people used to hate typed compiled languages and migrated to scripted dynamic languages en masse. Then they discovered they want performance of compiled language so they built JIT into their interpreters, eventually adding compilers as well into their languages. Then they also realized that enforcing types are actually good, so they built typing support into their languages, finally coming full circle after 20 years.

Re: A look at modern PHP

#503
post #112

The amount of misinformation, false claims and unsupported statements in this thread is mindblowing for the quality that I've been used to see on HN. Here are some facts: - Symfony was the backend framework with the most contributors in 2019 [1] (yes, out of any backend framework written in any language) - PHP has more active contributors than it ever had [2] - Laravel is one of the most used frameworks in the world…

>The amount of misinformation, false claims and unsupported statements in this thread is mindblowing for the quality that I've been used to see on HN. What if the assumed quality is an illusion and every discussion is actually as misinformed as this one, you just lack the knowledge to recognize it? Which doesn't have to be a bad thing since the signal to noise ratio on hn can still be better than somewhere else. (The…

> What if the assumed quality is an illusion and every discussion is actually as misinformed as this one, you just lack the knowledge to recognize it?

That would not be the entire explanation:

- I almost have bragging rights on certain topics and still find the discussions about said topics here on this site mostly good.

- Other people do actually have serious bragging rights and still continue to show up, so I guess HN isn't that bad.

Edit: although some of the reason for the last point could be the same as the reason why parents change diapers as pointed out a few hours or so ago: https://news.ycombinator.com/item?id=23077102 ;-)

Re: A look at modern PHP

#504
post #498

Earlier quoted context omitted.

I think there is a huge difference between web sites and web applications. Most large applications today uses SPA and an api. The api can be done in any backend language and there is not many obvious benfits of using php but some clear drawbacks. If you just want to create a web site quickly then php works fine but on the other hand you can do it quickly with js, c# or Typescript also.

> Most large applications today uses SPA and an api. I’ve been thinking a lot about this over the last year+. Is this true? Because the deployment model is 1000x more straightforward for CRA vs NextJS (nuxtjs, etc.).

CRA?

Re: A look at modern PHP

#505
post #494

Earlier quoted context omitted.

I was paid to build a Wordpress extension once. It was the most miserable programming experience of my life. Wordpress is no doubt a powerful force on the web. As a no-code website-creation environment, it's fine. Maybe even good. But as a library, it is godawful.

i haven't done wordpress in 5+ years but oh my god it had everything that's bad about php in it.

I wouldn't be shocked if Wordpress has singlehandedly tarnished the reputation of PHP in general

Re: A look at modern PHP

#506
post #200

Earlier quoted context omitted.

Most of the comments against PHP are from developers that wrote PHP There are still some issues but considering the current state of language, frameworks, libraries, and the ecosystem, it's very practical and productive environment to build any project. I've been doing Typescript, Scala, and recently also Go in last few years. Scala and Go have decent language design and I'm a fan of both of them. But, when it comes…

I think there is a huge difference between web sites and web applications. Most large applications today uses SPA and an api. The api can be done in any backend language and there is not many obvious benfits of using php but some clear drawbacks. If you just want to create a web site quickly then php works fine but on the other hand you can do it quickly with js, c# or Typescript also.

> Most large applications today uses SPA and an api.

[citation needed]

Re: A look at modern PHP

#507

Earlier quoted context omitted.

PHP isn't being replaced by Rust or Go. It's being replaced by Medium, Wix, and Squarespace. At this point, the predominant reason it's still undergoing active development is that there is a metric ton of legacy PHP code. As the businesses still using it either mature, evolve, or fail, the need for PHP will begin to dry up. You're defending the language from an emotional standpoint. > choosing php for a new project i…

> This is absolutely not the case, and you know it. Almost every language has a wealth of HTTP tools and frameworks, and many of them come built-in. Lots of languages have HTTP tools and frameworks, but not many of them are even comparable in scope to Symfony or Laravel. Out of curiosity, can anyone point me at some frameworks in other languages that have the following things built-in? * Route matching and dispatch *…

What do those mean?

> Hashing

> Encryption

> CLI commands with option/argument parsing, colored output, progress bars etc. (Do you mean a management console? All of them have it.)

Except for those, Django has every single one.

Re: A look at modern PHP

#508

Earlier quoted context omitted.

no PHP framework is similar to the thing that NextJS/Reactis doing. The output is the same (well, isn’t the point of web framework is to spit out HTML?) but the methodology is totally different.

And about 100x more complex and fragile.

Not necessarily. I recently rewrote an old web application written in php and jquery with django, react and typescript. The new application has roughly the same LoC count while having more features and better interactivity.

Re: A look at modern PHP

#509
post #112

The amount of misinformation, false claims and unsupported statements in this thread is mindblowing for the quality that I've been used to see on HN. Here are some facts: - Symfony was the backend framework with the most contributors in 2019 [1] (yes, out of any backend framework written in any language) - PHP has more active contributors than it ever had [2] - Laravel is one of the most used frameworks in the world…

You claim "misinformation, false claims and unsupported statements" while you yourself only appeal to popularity and habit. Those are not directly correlated to quality. It simply means that PHP in the eyes of the businessmen is the safer choice due to a much bigger hiring pool. The popularity and adoption have a snowballing effect; once a certain critical mass is achieved then the whole thing sustains itself.

Every reasonable programmer will agree with you that different languages serve different niches. Nowadays however there are several mature and solid web frameworks in other languages, thus PHP is very far from the only -- or the best -- contender in this area.

And yes, you are biased. That's quite okay. I can also make a ton of smaller projects in 2-3 days with Elixir's Phoenix -- some that have a smaller scope I can also do with Rust's Rocket even. But I don't claim they are the "no-brainer" choice. You should not too.

Finally, implying that choosing anything other than PHP makes the project a "for fun" endeavour is disrespectful and does not do your argument any favours.

Re: A look at modern PHP

#510
post #112

The amount of misinformation, false claims and unsupported statements in this thread is mindblowing for the quality that I've been used to see on HN. Here are some facts: - Symfony was the backend framework with the most contributors in 2019 [1] (yes, out of any backend framework written in any language) - PHP has more active contributors than it ever had [2] - Laravel is one of the most used frameworks in the world…

A lot of the common complaints about PHP are merely echoing the wildly outdated and misinformed "PHP: A fractal of bad design" that has been circulating for the better part of the last decade. Unfortunately people tend to uncritically repeat whatever it says without actually paying any mind to the facts that, 1) it's 8 years old, 2) it's flat out wrong about a lot of its claims, 3) it's evidently written by a guy who…

In regards to your last point, I believe PHP was intended to be a quick and dirty templating language for C programs. Right?

But if we're not using it for that purpose anymore, why would we want a programming language that grew haphazardly out of a templating language and is suffused with the quirks of that legacy? Yes, it's better than a decade ago and getting better all the time, but is it good yet? Does it have any advantage over more coherently designed languages?

Post reply on HN