4 ms·
This also leads to the rise of single tons and creating objects wherever you need them. It's hard to grok Dependency Injection when your objects live and die al
by jskulski 11y ago
This also leads to the rise of single tons and creating objects wherever you need them. It's hard to grok Dependency Injection when your objects live and die all the time.
It makes reasoning about state easy because you don't have to consider it. In my experience (which involves several large and mature PHP codebases), that's not a good thing.
You're right about the benefits, but the downsides are glaring too.
- Udo 11y agoI agree, and I see every day that PHP apps are not written with both these pitfalls and advantages in mind. Instead, most "foreign" PHP code I look at today is either made to look like it was designed for a Java app server or is so ineptly cobbled together that no apparent thoughts were invested into the structure at all. I blame both of these on the messaging and marketing coming out of Zend and the surrounding ecosystem, namely that PHP is supposed to be a language where big applications are constructed with convoluted EE-like class trees, and that PHP is supposed to be a beginner's language. Both of these constitute an outright failure to recognize where its strengths and weaknesses lie, in my opinion, by the same people who are maintaining the language.