|
|
|
|
|
by rickmb
5291 days ago
|
|
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. |
|
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.)