What do you mean lately? PHP has gotten tons of well deserved criticism since it was created. It isn't "hate" to point out that a popular language is much worse than many other comparable languages.
It becomes "hate" when the criticism is ill-informed and largely irrelevant. The bits of PHP that are "much worse" are mostly either legacy cruft that nobody in their right mind uses anymore, or bits are rarely touched in day to day programming but are safely wrapped in frameworks, ORM's, libraries etcetera.
Beyond that, PHP simply isn't particularly elegant (mostly since it was never really designed to be a programming language), and we all know it.
Other than that, I rarely see any relevant criticism, let alone constructive criticism.
Nobody can hate something as strongly as somebody who's spend way too much time looking at it. That, in this case, would be me.
Those frameworks and ORMs that you claim as a panacea are generally obfuscatory at best (Symfony2, which is a brilliant example of what you can do with PHP and a cautionary tale of designing a system that makes sense to twelve people, ever) to downright maliciously bad (CodeIgniter, get the hell out of my universe and take Joomla with you).
If you can muddle along with glacially inefficient frameworks (often with APIs that make core PHP seem not all that terrible for a time) and ORMs (personally, I don't use an ORM for anything, and credit where credit's due, PDO is actually a very reasonable solution), more power to you, but some of us (hi) have already been to that dance and realized it wasn't going to work for us. So I do criticize PHP on many fronts, from its psychotic language decisions to it's slapdash internals and it's blatant encouragement of idiotic programming practices. (You can say "nobody in their right mind would use that," but the existence of crapfloods of shitty PHP--hello, Wordpress--suggest that either that's not the case or the biggest PHP projects out there are run by lunatics.)
If I end up writing PHP, invariably I end up grabbing Silex and building the useful bits on top of that. While doing so, I continually wish it was a language where imposing actual application structure wasn't essentially actively discouraged; the outright necessity of shit like call-by-name loses what little error-checking you can otherwise get and the solution to any data storage problem seems to be "MORE ARRAYS!". PHP is a tool where a sufficiently advanced developer finds themselves fighting it as much as using it, and that is a shame. Because it doesn't have to be willfully obnoxious. It just is.
I mean, I went back to Java for my own projects, over continued bashing at PHP. That is a low bar. (But, to be fair, Play makes Java tolerable.)
Look, there are a number of criticisms of PHP that the language definitely deserves, but I'm not sure if you've hit on any of the legitimate ones.
the outright necessity of shit like call-by-name loses what little error-checking you can otherwise get
I'm sorry, but I use PHP everyday, and I rarely find myself needing to use call-by-name, except when it is required by internal functions. Many internal PHP functions that manipulate arrays do require the arrays to be passed by reference, but this doesn't prevent unit testing or error checking at all. I can't find any validity in this complaint and am assuming it is more problem of your coding style than an error inherent in PHP's language design.
the solution to any data storage problem seems to be "MORE ARRAYS!"
Brilliant observation. This is because arrays in PHP do double or even triple duty. They can be simple number-indexed arrays, they can be associative arrays, and they are internally implemented as hash tables, so they can also act as hash tables. Is your problem a semantic one or one of functionality?
PHP is a tool where a sufficiently advanced developer finds themselves fighting it as much as using it, and that is a shame.
"If you can muddle along with glacially inefficient frameworks (often with APIs that make core PHP seem not all that terrible for a time) and ORMs (personally, I don't use an ORM for anything, and credit where credit's due, PDO is actually a very reasonable solution), more power to you, but some of us (hi) have already been to that dance and realized it wasn't going to work for us."
Count me in as someone who took a look at the frameworks and said "no thanks". I think where the frameworks fail is that they always feel the need to go OO. PHP's design is pretty procedural in essence, because it's not a lot more than an HTTP wrapper with some useful procedures you can call. If you wrap that in an OO layer, by necessity you have to complicate things. I've found the best use of objects in PHP is in support of procedural request handler code. The only framework I use is ZF, because you can easily use it without buying into the whole MVC and routing paradigm.
Woah, in one sentence you claim about PHP devs feeling the need to go OO and then the next sentence you extol the virtues of ZF? ZF is all OO, all the time.
He already answered your question in the post you are replying to:
>because you can easily use it without buying into the whole MVC and routing paradigm
As much as I think the zend framework is terrible, you can pick and choose whatever bits of it you like and ignore the rest. There's no working around assumptions or anything, it is just a normal way of using the framework.
> it's blatant encouragement of idiotic programming practices
PHP doesn't encourage bad programming practices. It simply doesn't encourage good ones. That isn't just semantics, either.
There are times when you need to break the rules. They're rare, but they're there. PHP is a language which leaves you that option. If choose to use that optional frequently, then you have nobody to blame but yourself.
Agreed. The "largely irrelevant" point I think is key. Just about every PHP pitfall is avoidable when employing best practices (something that is encouraged for all languages anyway).
We see the same thing with JavaScript and C++ (to a lesser extent) because some developers are simply afraid that a less experienced programmer might commit the sin of using the "bad parts", as if Python and Ruby transform careless career programmers into artisans.
>The bits of PHP that are "much worse" are mostly either legacy cruft that nobody in their right mind uses anymore, or bits are rarely touched in day to day programming but are safely wrapped in frameworks, ORM's, libraries etcetera.
Huh? The article in question demonstrates otherwise, note they just now fixed one of the problems with anon functions, a relatively new feature. PHP continues along the path of adding "features" randomly and without even understanding the purpose behind the feature, and so you get half-features that kinda work and don't really solve any problem in the context of PHP, but were just added so they could check off "some feature we don't understand" on the feature list.
>Other than that, I rarely see any relevant criticism, let alone constructive criticism.
In the context of PHP, I think "you should use a better language" is as constructive as you can really get. There's nothing wrong with warning new web developers that PHP is worse than every other language that lives at the same sort of level (perl, python, ruby, pike, etc).
>PHP continues along the path of adding "features" randomly and without even understanding the purpose behind the feature, and so you get half-features that kinda work and don't really solve any problem in the context of PHP, but were just added so they could check off "some feature we don't understand" on the feature list.
This is not how features get added to PHP. Please spend some time on the PHP mailing list if you would like to know how it works.
When that "well deserved criticism" comes from the same people who feel compelled to post in every PHP thread, obsessively, over and over again ... it's hate.
Hate isn't inherently negative. You can hate evil, etc.
However, if you hate a programming language ... there's really something wrong with you. It suggests a very sheltered life. There are far more important things in life that deserve your hatred.
I think something that forces me, almost daily, to waste my time dealing with problems that are simply nonexistent in more sane languages deserves my hatred. (And I have a LOT of hatred for it!)
>When that "well deserved criticism" comes from the same people who feel compelled to post in every PHP thread, obsessively, over and over again ... it's hate.
No, you choose to label someone else's opinion as "hate" because it lets you dismiss it and throw out baseless insults at those people with less risk of getting taken to task for it. You told other people (theoretical people at that) what they think, and then told them there is something wrong with them and they lead sheltered lives. How incredibly arrogant.