2 ms·
If we forget about PHP for a while, I really like this way of constructing objects by using dictionaries (or environments or hash tables) and closures. In fact
by exDM69 15y ago
If we forget about PHP for a while, I really like this way of constructing objects by using dictionaries (or environments or hash tables) and closures.
In fact, I would prefer that in a dynamic language, it would be the only way of constructing objects. I don't see much point in having classes in a language like Javascript, PHP or Python and I almost never use inheritance in these languages. Stuff like instanceof is a bad match for duck typing. Single dispatch method invocation adds very little value to a language that is already ducktyped.