prototype for operator proposal for review
allen at wirfs-brock.com
Wed May 18 09:47:36 PDT 2011
On May 18, 2011, at 9:20 AM, Brendan Eich wrote:
> The only thing that nags is the proto being on the left of the "triangle-arrow". Other languages and type theory use < or <: to put the extension or more-derived thing on the left, but here the extension (value not type, but still) is on the right.
> Maybe I'll get over this, though. The use-case with an object literal as the extension really must be on the right, I quite agree. Does |> work any better?
We probably could make :> work (but, gag, typing this message on my Mac using Helvetica 12 the : is practically invisible next to >. <: doesn't seem to have quite the same problem for some reason).
I think I like <: about as much as <|. I'm not sure which is going to be more readable across a variety of fonts and sizes. <| does seem to be generally more visually distinct.
I suspect that to most JS programmers the UML open triangle generalization arrow head is at least as relevant a precedent as any type theory uses. In other words,the relevancy of either isn't very high.
One might argue that the prototype object is the more general and hence "smaller" object (the object on the right specializes the prototype by adding properties).
In the end, these are just symbols and JS programmer are just going to have to learn their meaning. Existing conventions, if they exist, and analogous do impact initial learnability but in the long run I don't know if it makes much a difference as long as they aren't prone to keyboarding hazards.
More information about the es-discuss