It might be better than Perl, but not by much.
It might be better than Perl, but not by much.
Oh come on.
PHP is more evolutionarily fit than Perl in a handful of very important ways (I would illuminate, for example, function signatures and a pre-built object system, syntactically trivial nesting of data structures, and a newcomer-friendly out-of-the-box execution model).
That said, I wrote Perl for years as a hobbyist (still do, now and then), and have spent the last 6 or so primarily writing PHP. There is not a day that passes that I don't miss some aspect of the rich, expressive, elegant, sophisticated, and intellectually delightful environment that is Perl at its best.
It is a doomed and sinking continent, Perl, but if we let the considerable wisdom of its once-great civilization evaporate into trite dismissal, we as a culture stand to lose a great deal.
I always found PHP's insistence on the array() keyword annoying, and the mixing of associative and sequential arrays ambiguous.
Perl's data structures (in their simplest form) and JSON are very similar, and I think JSON is a fine format.
You're mostly right on the other points though. Although I do love Perl's use of signatures in some cases.
You can now write
$numbers = [1,2,3];
Or even $numbers = ['first' => 1, 'second', => 2, 'third' => 3];
I'd think the mixing of associative and sequential arrays are one of the key things that lowers the barrier to entry though.I'd think the mixing of associative and sequential arrays are one of the key things that lowers the barrier to entry though.
For me it fails the "similar things should look similar, different things should look different" test. Then again, they aren't really all that different in PHP. I guess it comes down to me preferring my sequential and associative data structures to be separate, which is a fairly fundamental difference to how PHP thinks it should be. I have a sneaking suspicion that the complexity this data structure tries to hide leaks out through the numerous functions used to interact with it[1], which just shifts the pain slightly farther down the line, and possibly from a one-time event (when learning the fundamentals) to a regular occurrence as it causes problems continually later.
PHP The Right Way (http://www.phptherightway.com/) is a good place to start if you're curious what "modern PHP" looks like.
PHP, heavily used in production, godawful language.
Perl, heavily used in production, godawful language, but at least it's not PHP.
Python, heavily used in production, pretty good language most of the time. (It's refactoring effort is Python 3, but ended up not changing very much.)
http://www.xent.com/pipermail/fork/Week-of-Mon-20070219/0441...
Haskell and I have been doing well so far in the "RealWorld" and I hope it keeps going that way :D If not, I'll probably put more time into python and C again.
(Although I should add it's a few years since I've played with Haskell. Maybe things have moved on....)
The accidential memory leaks still exist.
I prefer to emphasise the "... once you understand them" bit.
I haven't ran into memory issues yet, but I have heard others have a very hard time reasoning about memory/space leaks. However, something I hear less often is that the memory problems people have also happen in other languages.
The project I'm working on (https://github.com/idno/idno) is PHP, but explicitly doesn't support legacy versions, in order to rule out the way of working that was finally made obsolete in v5.3. I'm very happy with the language, and I can usually express what I need simply. Reflection could use a little love, mind you.
I do a lot of PHP programming. Frameworks like Laravel are a godsend. Sometimes I have to work on a Wordpress project and it makes me cry.