You're right, it's not inherent to nor exclusive of PHP developers. It's entirely possible to write good code following good design patterns in PHP. But regardless of reason, that's not encouraged in the PHP community. A person who starts out writing PHP and stays in PHP development is, in my experience, far less likely to follow good design patterns.
I think it depends on the community you're involved in?
For example, Laravel, Slim, Symfony and Yii frameworks do encourage good design patterns (Laravel may have fallen off the wagon here though). I've seen pretty good code from October CMS, Craft CMS and even Magento 2.1 is decent.
A lot of the PHP community is modernizing very fast even if WordPress can't (or won't). I think a person who starts out writing PHP today on a modern PHP framework will be almost as likely to pick up good design patterns as someone who is starting, say, .NET Core.
Actually, those frameworks don't encourage good design patterns. Those frameworks copy design patterns from other languages, assuming that "design pattern" is a proxy for software quality. The flaw in this is that the PHP runtime is not suited to executing large amounts of "Design Patterned" code. It's cargo cult software engineering.
Symfony is by far the worst of these that I have seen. It's like they sat down and said "let's copy Dependency Injection from Spring, templates from Django, and routing from Ruby. Then we'll offer a choice between two different ORMs that are both broken, because ORMs are 'modern.' Finally, we'll slap the label 'Enterprise' on it so that people will finally take PHP seriously."
By 'design patterns' I assume we're talking about following SOLID principles, which even when copied from other languages involves dependency injection, factory methods and singletons.
I agree that on some of these are a burden on PHP (mostly PSR-7), but as you mentioned that's the direction most languages/frameworks are following nowadays. It isn't necessarily good but frameworks and design patterns aren't about saving execution time, but saving development time and increasing maintainability by adhering to easy(ish) to follow concepts
On Rasmus, having met him once I'm not at all surprised that he thinks they all suck. I would disagree because I do like the Slim 3 framework although I wish it hadn't been an early adopter of PSR-7 because it feels like a heavy-handed solution to an infrequent problem. But I'm not sure we have good alternatives here. We can go back to spaghetti code or write a better framework
1. Don't write object oriented PHP. Despite the promise it showed early on, history now tells us that "Object oriented" is not a guarantee for quality, nor does it prevent spaghetti code.
2. Write framework-compliant object oriented code in another language/runtime more suited to executing it (basically anything that doesn't try to live directly inside the Apache request/response cycle).
You might not consider them "good" alternatives, but I think they are the choices a lot of people eventually end up choosing between.
I generally agree that frameworks are good to use for saving developement time, but execution time matters. The performance penalty paid for some of these frameworks on PHP compared to the two alternatives above is large enough to negate the benefit for all but trivial cases.
That's fair. I've been stuck dealing with CodeIgniter people for the last year, and that's a shitshow and a half. It's likely colouring my perceptions, especially coming from the Rails community. God, I miss Rspec.
I came from Rails into WordPress and the stink that I've picked up from having this on my resume has definitely hurt my career prospects...not like I'd rather be working on Rails right now anyway.
I've resigned myself to digging deeper into Elixir and Erlang and using my Ruby background to get the next gig.
I interviewed with some folks recently who are primarily CodeIgniter and transitioning to Laravel -- wasn't a fun interview. They just couldn't see the benefits of a functional style anywhere in PHP.
I guess. The last year and a half I've done nothing but heavy WordPress backend and plugin development and large ETL projects in Ruby. Right now I'm working on a Jekyll with WordPress-as-CMS backend architecture for a high-traffic site.
I think I'm building really cool stuff but when I talk to the kinds of companies I want to work for here in NY, most people seem to just tune me out the second I mention WordPress.
I'd have an easier time if I spent a lot more time working with Node and React, but for the work that I do here those are the wrong tools.