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.
PHP 8.1.0
141–150 of 286 posts
Re: PHP 8.1.0
#142Earlier 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 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
Re: PHP 8.1.0
#143Earlier 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…
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
#144I'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…
Re: PHP 8.1.0
#145Earlier 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.
Re: PHP 8.1.0
#146Earlier 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…
Re: PHP 8.1.0
#147Earlier 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…
Re: PHP 8.1.0
#148Re: PHP 8.1.0
#149Who is still using PHP anno 2021?