Live data from Hacker News

A look at modern PHP

lwn.net

291–300 of 610 posts

Re: A look at modern PHP

#291
post #272
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…

Can't speak for others but I've worked on many legacy PHP codebases over the years, it has never been a pleasant experience. Even when it's a PHP 7 codebase the same bad practices from PHP 5 and earlier are all present and accounted for. As are the subtle bugs stemming from an inconsistent standard library and PHPs approach to error handling. I'm sure that there's plenty of good PHP code out there, maybe I've just be…

Ya?

Can't speak for others but I've worked on many legacy C++ codebases over the years, it has never been a pleasant experience. Even when it's a C++ 17 codebase the same bad practices from C++ 11 and earlier are all present and accounted for. As are the subtle bugs stemming from an inconsistent standard library and C++'s approach to verbose error handling. I'm sure that there's plenty of good C++ code out there, maybe I've just been unlucky.

I can literally copy and paste what you said replacing it with any language and end up being correct.

Every single language on a legacy code base will have good code and bad code. It has NOTHING to do with the language. It has to do with what the code is and who originally developed it.

Re: A look at modern PHP

#292

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

Mojolicious (Perl) has just about all those things. It's been a while since I've looked at it.

Re: A look at modern PHP

#293
post #285

Earlier quoted context omitted.

You can hire "good programmers" and ask them to write PHP - Facebook does

Facebook writes Hack, which is nontrivially different from PHP, and those differences matter.

I doubt that Facebook tries to hire Hack devs off the street. No one uses Hack except FB. They hire PHP developers and teach them Hack in boot camps.

The point being, you can hire good php devs.

Re: A look at modern PHP

#294

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…

Coming from Java, the one pet peeve I have is the automatic type conversion. I just find that I never really know what my variables are _really_ holding. It's one of those foundational issues that I just can't get over. ...but it's my personal problem - I don't hate PHP.

Work as a PHP dev, in a PHP/JS shop.

In all new work we require static typing on method parameters and defined return types. Of course, if your type is 'array' it could be an array of anything but we also try to avoid that and use collection classes. It honestly feels a lot like Java now, without the compile step.

Re: A look at modern PHP

#295

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…

What are "string keys"?

Re: A look at modern PHP

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

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.

Re: A look at modern PHP

#297
post #283

Earlier quoted context omitted.

"PHP only exists today because of legacies being maintained" I think, the reason is, Facebook poured a load of money/time into PHP. Otherwise it would probably on life-support right now.

Facebook poured loads of money/time into HHVM. While I'm sure PHP also got benefits, your "Otherwise it would probably on life-support right now. " argument fits perfectly on the rest of the biased unsupported arguments.

I used PHP in v4/5 times and had the impression development slowed down until I heard about all the "FB being bullish on PHP" announcements.

Re: A look at modern PHP

#298

Earlier quoted context omitted.

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…

What are "string keys"?

Associative array or hashmap. Arrays indexed by strings instead of numbers.

Re: A look at modern PHP

#299

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…

For a huge, huge potion of all work done by web developers day to day around the globe the language doesn't matter if the framework is productive and secure by default.

Most of it won't survive a handful of years at best and most companies won't ever benefit from the attitude of some developers that ever developer on ever task should be writing FAANG level code.

What 3nds yo happening it matter what you do is the next agency / person comes along and claims its not fit for purpose any more and redoes it 'better' and the cycle continues of low value

Post reply on HN