DEV Community

Discussion on: All I want for PHP is 🐘

Collapse
 
andersbjorkland profile image
Anders Björkland

They are very different paradigms. I've heard of people writing beautiful code in WP, but I'm not one of them. Though it did feel magical writing the first theme myself. However, I like following the standard recommendations and Symfony has helped me do that. It's a bit cleaner, and I do like the injection containers!

Collapse
 
leob profile image
leob

I have to admit that I have no idea what modern WP code looks like, I worked with it more than 10 years ago and back then it looked like glorified spaghetti code, certainly not like beautiful elegant OOP code. But like I said, I don't know what it looks like these days.

Thread Thread
 
andersbjorkland profile image
Anders Björkland

It's like how I first was introduced to PHP. I just wanted a simple website and bought a book that had me hammering out spaghetti. That code is nowhere to be seen today (I HOPE!). And that's kind of the way that WP works too. You could do as much spagetti as you like and easily mutate something that is used on the other side of the project. But you could be sensible with it too! Though I've never been 😉

Thread Thread
 
leob profile image
leob • Edited

Yeah for sure PHP has come a long way ...

I mean, old skool PHP was just ugly "script" with as little structure as possible lol ... modern PHP allows you to write beautiful OO code, and it's pretty fast as well - performance of PHP has improved by leaps and bounds since PHP 7 and 8, and stuff like Swoole really puts it in "turbo" mode (and even allows you to do event driven programming if you want) ... types and type checking are being added, I could go on - honestly I think modern PHP is giving Node.js a run for its money ;)

Thread Thread
 
andersbjorkland profile image
Anders Björkland

Some nice additions to the language is stuff that we may not even notice. As you say, there's been great preformance boost with 7 and then with 8. JIT is behind the scene doing its thing. Fibers I won't touch but taking advantage of with PHPReact (or maybe framework-x). And yeah, looks pretty swell being a PHP Developer using modern tools right now 😁

Thread Thread
 
leob profile image
leob

It does, modern PHP is powerful and nothing to be ashamed of ;)