Live data from Hacker News

PHP 8.1.0

php.net

141–150 of 286 posts

Re: PHP 8.1.0

#141
post #32

Earlier quoted context omitted.

Elegant is not the word I'd use to describe PHP. Solid, perhaps. Undoubtedly useful. But if there is elegant PHP, I haven't seen it.

Have you looked at any Laravel code? As someone who has worked from small startups to FAANG and inbetween, Javascript to PHP to Python to Go, I haven't found anything more elegant.

I think most people outside php have no idea what Laravel is, while anyone working in php is using Laravel so basically our viewpoint is Laravel = php. I don't know what it is about the normal personality that anyone using something you don't understand just be "doing it wrong"

Re: PHP 8.1.0

#142
post #52

Earlier quoted context omitted.

Phabricator, much like WordPress, kind of lives in its own world and hasn't adopted most aspects of modern PHP. Even as someone who works with PHP and enjoys it, I wouldn't want to use Phabricator.

Wordpress has taken great strides to comply with the latest PHP standards so I'd say that's not quite fair to include it here.

I would say some contributors comply with standards - but the stuff coming from Automattic is scary.

I ended up in a position where I've become responsible for a very high volume WooCommerce/Wordpress store and the things that I've seen in _brand new code_ is mind boggling. Their new, branded, in-house paypal plugin/integration is currently at 1.5/5 rating on the wordpress plugin marketplace [0]. It just doesn't work for various reasons for various people. It's 2021, how do you screw up a payment gateway for wordpress when you _are_ wordpress? But wait, there's more. They already had PayPal integration, built into the core and already included in all WooCommerce installs. So what to do? Force disable the already existing, working-properly, integration and recommend their new plugin to be used. [1] This is hostile.

If your woocommerce webhook delivery fails 3 times in a row, woocommerce will just turn off that webhook/stop delivering them. Silently. No option for any sort of alert to be sent/logged, no way to store/replay the missed webhooks. Just off. This is irresponsible.

Our installation happens to have a lot of details that go into each line item on an order - which, in turn, turns into many rows of meta data. Woocommerce doesn't rely on dedicated tables for orders or related metadata, it's all stuffed into 'posts' and 'post_meta'. It doesn't scale well, terrible really. It's a large enough problem that LiquidWeb starting working on a fix for high volume sites that end up getting crushed with database/performance issues related to these tables/the way the order data is stored. [2][3] This was supposed to merged into the WooCommerce core but that seems to have stalled/fizzled.

I was able to reduce response time on an API request to get_order() from 3-5s to 0.25s by adding an index to the meta table mentioned above. (The query wasn't using any index) This likely isn't the case for the vast majority of installations, or it doesn't matter because the databases are small enough. But things like this indicate to me that the test suite/benchmarking is seriously flawed - or they're not doing things like testing and benchmarking against real-world databases.

Taking a look at various release notes the types of bugs seem to indicate to me there's not a lot of automated testing going on or that things are so convoluted/messy that it's become too complex.

All in all, for the people behind the PHP workhorse (the hero we deserve...) it's all pretty scary. The code quality, quality control and just about everything leaves a poor taste in my mouth. I'm not a big "Team PHP" guy - I like the idea of using the right tool for the job and the scary thing is that Wordpress is the right tool for the job for a lot of people. (WooCommerce, these days, is basically never the right tool)

This is a terrible look for PHP.

Laravel/Symfony on the other hand... take my money. It's a pleasure. LiveWire, tailwind, oh my.

There's still a place for Wordpress - it's not going anywhere... but it's got a long way to go before I'd say it's anywhere near ok. Let alone approaching latest standards (even despite it's supporting older versions of the language). Can we get first-party/first-option composer support? Why, again, is it another company driving Wordpress forward? [4]

[0] https://wordpress.org/support/plugin/woocommerce-paypal-paym...

[1] https://developer.woocommerce.com/2021/07/12/developer-advis...

[2] https://github.com/liquidweb/woocommerce-custom-orders-table

[3] https://stevegrunwell.com/speaking/woosesh-2019/

[4] https://roots.io/

Re: PHP 8.1.0

#143

Earlier quoted context omitted.

I would say that Ruby on Rails is a pretty good candidate to completely replace PHP with.

I think you (and to be fair, many people) are missing a huge part of why PHP is still popular. Saying Ruby can replace PHP sounds to me like saying that Ruby can replace Excel. It's fundamentally misunderstanding _why_ it's popular in the first place. I have a HTML page. How do I add a hit counter to it with Ruby? I can do it right now in PHP with zero dependencies and it'll fit in this comment: You are visitor numbe…

This example seems to be a great demo of why people do not like working with PHP. PHP makes the shit method the massively simpler way and the good method much harder. Now you open yourself up to risks like what happens if we accidentally let some user input change the file opened as well as the content written.

While with rails, to do basically anything, you already have a full db ready and incrementing a counter using the ORM is even easier than opening a text file. So people avoid PHP because it most likely involves dealing with absolute crap code written with no understanding.

Re: PHP 8.1.0

#144

I've been using PHP since 5.x. Often had to work on older 4.x web apps. I find it interesting when I read people saying "PHP has come a long way. It's a proper language now, etc." If you work long enough with a language and figure out most its quirks, it's a breeze. It's nice that they are adding all these new features, but they are hardly what makes it or break it for me. Here is the one features that is taken for g…

The idea that development in golang is slow is funny.

Re: PHP 8.1.0

#145
post #97

Earlier quoted context omitted.

PHP is elegant and useful. The spread operator is ...$array is elegant. $var ? "not found"; is really elegant.

It’s also about ten years later than everyone else to get those splat and null coalesce operators so it’s not like that elegance is unique or even timely for PHP.

Your post is 10 years too late because we are talking about php today. PHP was elegant in different ways 10 years ago.

Re: PHP 8.1.0

#146

Earlier quoted context omitted.

I would say that Ruby on Rails is a pretty good candidate to completely replace PHP with.

I think you (and to be fair, many people) are missing a huge part of why PHP is still popular. Saying Ruby can replace PHP sounds to me like saying that Ruby can replace Excel. It's fundamentally misunderstanding _why_ it's popular in the first place. I have a HTML page. How do I add a hit counter to it with Ruby? I can do it right now in PHP with zero dependencies and it'll fit in this comment: You are visitor numbe…

This makes my eyes bleed.

Re: PHP 8.1.0

#147
post #52

Earlier quoted context omitted.

Wordpress has taken great strides to comply with the latest PHP standards so I'd say that's not quite fair to include it here.

I would say some contributors comply with standards - but the stuff coming from Automattic is scary. I ended up in a position where I've become responsible for a very high volume WooCommerce/Wordpress store and the things that I've seen in _brand new code_ is mind boggling. Their new, branded, in-house paypal plugin/integration is currently at 1.5/5 rating on the wordpress plugin marketplace [0]. It just doesn't work…

Ok, going to say you reminded me and I agree now. I was thinking solely of WP core, but if you are to include all of the official plugins and Woocommerce, then yeah I can see the issue.

Re: PHP 8.1.0

#150
PHP has a lot of warts, and I mean a lot, but one thing I really like about PHP that virtually no other Web languages offer is that I can just drop code in my Web server's document root, go to that path in my browser, and it runs, without needing to deal with frameworks, boilerplate, compiling, etc.
Post reply on HN