slightlyoff / Promises

DOM Promises IDL/polyfill
Apache License 2.0
154 stars 28 forks source link

Bikeshed: `Future` or `DOMFuture`? #11

Closed slightlyoff closed 11 years ago

slightlyoff commented 11 years ago

The current design squats on the name Future, potentially precluding others from defining it sanely in ES5 contexts. This is potentially problematic as one goal of this proposal is to allow ES7 to specify a subset of the behavior we outline in a JS-standard Future type. Should we move Future to DOMFuture?

annevk commented 11 years ago

Do we want to end up with both? "DOM" is an ugly prefix imo.

slightlyoff commented 11 years ago

@annevk: I think the thought here is that the DOM version would end up subclassing the pure ES one once it exists, adding the EventTarget bits. Not sure what we need to do to make that play nicely...thoughts?

annevk commented 11 years ago

Maybe EventFuture then?

I'm still a bit unclear as to how JavaScript is going to utilize this. Are there any APIs that will be part of JavaScript that need this?

slightlyoff commented 11 years ago

Lots of JS APIs need this, and it's common enough in libraries that they're all providing it. As a result, JS will likely get a subset of this. So yes, JS needs it. I'm fine with EventFuture...others ideas?

annevk commented 11 years ago

(Since we have DOMException and DOMError, maybe it's not too bad after all, even though slightly ugly and somewhat weird.)

marcoscaceres commented 11 years ago

The word "Future" doesn't really give you much clue about what it does. It sounds cool, but...

slightlyoff commented 11 years ago

API names take on meaning both through use and through naming (usually in the reverse of that order).

marcoscaceres commented 11 years ago

Sure, but "future" is not really indicative of function or role. Like "a DOMError is an error that ...", while a "a DOMFuture is a future in which ... dinosaurs still roam the earth". If a future is really just a promise in disguise, then call it DOMPromise?

slightlyoff commented 11 years ago

Not going back to "Promise". We ended up at "Future" because "Promise" is far too loaded a word. Sorry.

marcoscaceres commented 11 years ago

Ok, but everyone is just going to say "Oh! a future is just a promise..." or "futures are the promises of the Web" and the such. And, "what's this futures thing? ... oh, a promise! why didn't they just call it that?!"

rauschma commented 11 years ago

It might be worth pointing out somewhere in the docs that future is actually the more established term for this kind of thing. Beyond JavaScript circles, I even suspect that more programmers know “future” than “promise”.

marcoscaceres commented 11 years ago

@rauschma, might be helpful - though why we care what programmers outside the JS community call these things is not clear to me. But anyway, enough bikeshedding. @slightlyoff, if you are not going to change it, then please close the bug.

slightlyoff commented 11 years ago

Well, the question I'm asking is "Future" or "DOMFuture", not "Future" or "Promise". We don't seem to have resolution on that question yet.

marcoscaceres commented 11 years ago

Ah, sorry. I got the sense that was resolved. FWIW, I like DOMFuture for the same reasons @annevk gave.

slightlyoff commented 11 years ago

OK, I'm sold. Will rename. Thanks all.