3 ms·
PHP is missing many features that good programmers need to write good code. Anonymous functions, lexical environments, the list goes on. You can write OK code
by jrockway 17y ago
PHP is missing many features that good programmers need to write good code. Anonymous functions, lexical environments, the list goes on.
You can write OK code with PHP, but you can't write excellent code.
(And no, I am not implying that code is bad unless you use a lot of anonymous functions. I am just saying that it's an essential tool that you really need when certain situations arise. In PHP, those situations will have to involve hacks.)
- ars 17y agoPHP has anonymous functions, so I guess now you love PHP. You say the "list goes on" - so I googled for a list http://www.tnx.nl/php.html http://www.tnx.nl/php.html. And half the things on the list aren't even true! And the rest are style choices (more functions with less parameters, or fewer functions with more parameters).
- jrockway 17y agoHere is a list: continuations, closures (which is what I really meant by anonymous functions and lexical environments, but I guess the term "environment" is not familiar to people that don't program CL), macros, real OO (classes/traits, first-class attributes, a metaobject protocol, etc), a sane type (constraint) system, and so on. Nobody cares about the order of arguments to a function in the standard library, that's trivial to ignore and fix. What PHP is missing is a way to extend the language, which means you are stuck with whatever the designers give you (which sucks hard). Anyway, if you haven't used these features before, you might not see the need; see the "Blub" essay for details on that.