Live data from Hacker News

A look at modern PHP

lwn.net

511–520 of 610 posts

Re: A look at modern PHP

#511
post #130

Earlier quoted context omitted.

Symfony is an outstanding framework and a real pleasure to build with.

I have a love/hat relationship with Symfony but it is a a very well run project, the attention to developer experience is very underrated.

Must confess I do have a special hat for writing YAML :)

Re: A look at modern PHP

#512
post #17

I've been using PHP for over 15 years and always liked it. There is no other webserver language that's so easy to use and so deployable while still being fast. But for larger projects the available frameworks are just okayish. I think Symfony is closest to what a good framework should be. But every time I use it I wish it would be like .NET Today .NET core is also available on Linux and very easy to deploy so I don't…

As someone with 0 experience in .NET, I'd love to hear what's so cool about it.

Honestly, as a PHP hater that got much more experience in .Net than PHP, it both were the only options, I would go with Laravel without any doubt.

C# is an inflexible language that just can not have a modern web framework on it. MS extended it with hard-coded functionality to closely emulate a framework and did an ok job on it, but it emulates a closed down, inflexible framework that is stuck in time. It's not a disaster, but it doesn't compare to the stuff that has kept evolving for the last decade.

Re: A look at modern PHP

#513
post #200
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…

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…

> If I was about to build my own web startup, I'd definitely build it with PHP because I'm sure I could launch it 10 times faster with Laravel.

Fair enough, and same applies to Ruby on Rails.

Let's not conflate "easy and quick to launch an MVP" with "sustainable for long-term development" however. There are many stories on the net how people started with something as basic as WordPress or Rails but had to rewrite in Phoenix or one of Python's frameworks down the line because the maintenance burden of the MVP-grade technology was too heavy.

Re: A look at modern PHP

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

It's amusing to me to see all the hate for PHP, especially when the original lazy gripe was that people hated when faced with code that was mixed with templates. So completely different than the dominant modern front-end frameworks.

At least one of those front-end frameworks doesn't "mix code with templates", it represents HTML as code.

(It's for that reason that JSX is the first way-to-splat-HTML-out that hasn't made my skin crawl in...pretty much ever.)

Re: A look at modern PHP

#515

I wonder if most developers that trash on PHP for trivial issues like seen in this thread haven't been using it for many years, or had a bad experience (e.g. maintaining a legacy app). Some developers live in a kind of technical vacuum where, I guess they assume, the technical features of their programming language are what makes the difference in the value of the business they're building. In reality, the difference…

I'm a PHP "hater", so take this for what it's worth. You are very close to implying that the language doesn't matter if you can hire developers and there are a lot of good packages in the ecosystem. Having worked on several PHP projects (Most being version 7.0+ and zero of them being older than 5.3), the languages is STILL full of gotchas, and it's a huge drag on productivity. I assert that this DOES matter. Even bas…

The PHP deal-breaker is that it casts[0] string keys that contain "valid decimal integers" to "the integer type"?

Seems like a fairly minor language quirk (of which almost every language has) rather than a huge feature that makes one want to avoid the language at all cost.

Of course, feel free to make your own choice when picking a language, but I don't think this is a compelling reason why one would always want to avoid using PHP for their web backend.

[0]: https://www.php.net/manual/en/language.types.array.php

Re: A look at modern PHP

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

Even with all of that, PHP still has strange quirks that aren't exactly obvious and are head-scratchers. Like the implicit type inference. One prominent example is that if all the keys in your "string" array are actually number strings like "123" and "456" then PHP will silently convert them to integers.

WTF?

So what is "PHP intended to be" in this case? And how is the above behaviour the sensible thing to do?

Whatever PHP "was intended to be", this is a gotcha that is absolutely unnecessary and sticks out like a sore thumb in today's ecosystem of stricter and more predictable and stable languages.

Let's not forget that commercial programming should not be about joining tribes that share your personal philosophy. It's about getting a job done. Predictability and stability help a lot with that.

Re: A look at modern PHP

#518

Earlier quoted context omitted.

Why would RoR bake payments support into the framework? RoR is there to tackle common web application tasks, payments is there for maybe 30% of web apps / services. There's an active debate on what popular libraries should be included in Rails, and all the features you listed can be found in libraries if they aren't in Rails already.

> Why would RoR bake payments support into the framework? I'm not saying they should, just comparing features for the sake of demonstrating that the functionality that's present in modern PHP frameworks isn't readily available in just any random framework in any random language.

This is the same kind of argument used to prove that Macs are actually cheaper than PCs. Start from the hardware specs of a particular Mac model and configure a PC to match those exactly. It will probably be more expensive than the Mac.

The thing is that nobody would choose that configuration for the PC under normal circumstances. Normally you would spec it based on your actual use case and the PC would end up both cheaper than the Mac and better suited to the use case.

Re: A look at modern PHP

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

It's amusing to me to see all the hate for PHP, especially when the original lazy gripe was that people hated when faced with code that was mixed with templates. So completely different than the dominant modern front-end frameworks.

It's even more amusing how gross a generalisation you are making. I for one dislike PHP for all its little nasty surprises like implicit type conversion. Even 15 years ago I had zero problems with code and templates mixed in a file.

Re: A look at modern PHP

#520
post #498

Earlier quoted context omitted.

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

Create React App: https://create-react-app.dev/
Post reply on HN