4 ms·
Really? I've heard all these ridiculous analogies but for some reason no one's every written up actual PHP examples to explain why this is true (Most of the ex
by Osiris 13y ago
Really? I've heard all these ridiculous analogies but for some reason no one's every written up actual PHP examples to explain why this is true (Most of the examples in that link are weird things I've never seen anyone actually do).
I've spent the last 8 months writing a fairly complex application as a REST API entirely in PHP and I can't say that I've ever run into any weird scenarios where I think to myself, "Damn, this is sure it like have a hammer but with claws on both sides."
My code is very OOP relying heavily on my own classes and not quite as much on the built-in PHP functions. I have also found that when I need to do something odd that there's usually a pre-built function already in PHP for doing it.
So if you're going to bash PHP at least throw out some actual PHP code and explain why it's bad (and make sure to point out that there's no other really good way to do it in PHP using you're own classes/methods).
- eevee 13y agoWeird things you've never seen anyone actually do? Test for equality, build data structures, handle error conditions? There's lots of example code, inline, but much of the article is about missing/broken features and artifacts of the design that make it unfriendly to wetware.
- adambard 13y agophp > $x = array("a" => 1, "b" => 2); php > echo $x["a"] . "\n"; 1 php > echo array("a" => 1, "b" => 2)["a"] . "\n"; PHP Parse error: syntax error, unexpected '[', expecting ',' or ';' in php shell code on line 1 I don't mean to denigrate everyone who uses PHP. But there's a whole world of great languages out there, and the vast majority of them act in more consistent (not to mention pleasant) ways than PHP. When I got into web dev I spent 2 years developing in PHP before moving on. My programs worked fine, eventually, and some were even well-written. I'm sure yours are too. That doesn't make PHP any less of a mess. But I never understood until I moved on to Ruby and Python and beyond just what a mess it was.