2 ms·
I was never on the promise bandwagon because they never did anything useful other than create hype with developers around using a more functional approach - whi
by marknadal 9y ago
I was never on the promise bandwagon because they never did anything useful other than create hype with developers around using a more functional approach - which is good, but promises themselves add no benefit.
For instance, people previously would do:
```
start(x => doA(y => doB(z => doC(end))))
```
When they could have just used named functions, with promises or not, it is just that promises was hype that taught them good programming skills:
```
doA = x => doB(x)
doB = y => doC(y)
doC = z => end
start(doA);
```
As with promises:
```
start.then(x => x)
.then(y => y)
.then(z => z)
.then(end)
```
The only real value of a promise now is being able to use `await`, which is the real first-class language magic.
However, the future isn't even with promises, so there is no need to change or modify them. The future is chain reaction programming, also goes by the name of observables/FRP/stack-based-cocatenative-programming/railway-programming.
Programming Chain Reactions is great, because they can also downconvert easily to `await`, so you get the best goodies of all the world.
We've implemented observable/FRP/chain-reaction programming as the default API in https://github.com/amark/gun https://github.com/amark/gun , it is really quite pleasant language abstraction. However, FRP/etc. hasn't quite hit "mainstream" hype yet, so developers do not know what they are missing out on. Once you try it and it "clicks", you realize the future is truly bright. :)