3 ms·
I don't like this. Even the author's own example shows how this gets very confusing even with simple code: var a = future; console.log(a); // will pr
by arnarbi 12y ago
I don't like this. Even the author's own example shows how this gets very confusing even with simple code:
var a = future;
console.log(a); // will print 'hello'
a = 'Hello'
a += ' World!'
console.log(a); // will print 'Hello World!'
Deferreds/promises are good exactly because they explicitly state what they are through their type, and they behave the "same" whether they are resolved or not.
This proposal breaks the notion of what a variable is, and it behaves very differently whether the future has been replaced by a value or not. This will become confusing very fast and a great source of race conditions.