4 ms·
This is a great idea. I'd love to see a language that was somehow compatible with mod_php yet was redesigned with sound principles in mind. PHP is handicapped i
by Scriptor 18y ago
This is a great idea. I'd love to see a language that was somehow compatible with mod_php yet was redesigned with sound principles in mind. PHP is handicapped in that it started as more or less of a tool for counters, and also because its inner workings don't seem to change very much.
It is because of this that major new features seem to be dirtily patched on: Namespace separators require a completely new syntax, anonymous functions that inherently can't behave like closures. Also, the language just seems like a meddle of things that have to be forcibly patched together to work together. For example:
array(1,2,3)[0]
(new FooObject())->some_method();
Neither of those work, yet the equivalent works in other languages. Personally, I like the idea of a language where new features emerge out of smaller bits bit put together in different ways. This is clearly not how it works in PHP.
- mst 18y agoThis is where, for all its mistakes, perl5 has won big - the core language itself provides basically an OO construction kit, and so over the years CPAN has iterated repeatedly towards better object systems. The latest, Moose, which is rapidly taking over the perl world, comes close to providing a superset of the features available in competing languages - and with the advent of the Devel::Declare syntax creation system we're able to add new keywords to support this, resulting in the MooseX::Declare system. While people often complain that perl5 should have these things out of the box, I think it contributes to the longevity of the language to be able to provide them externally on a solid core - if somebody comes up with a better set of ideas, new code can switch to using those, and current code will be unaffected - as we're currently seeing with projects using Moose for new code without having to touch any of their existing classes.
- fizx 18y agoWhat's with the downvotes? I found that insightful.
- eru 18y agoI was bitten by something like array(1,2,3)[0] once. I got especially mad because it is the php parser that throws up. That thing must be full of special cases.