3 ms·
Promises are the most awful programming syntax I have ever come across. Await is sweet release from death as nowadays almost all apis are forced onto promises.
by emilfihlman 5y ago
Promises are the most awful programming syntax I have ever come across.
Await is sweet release from death as nowadays almost all apis are forced onto promises. Thank god xhr and websockets came before promises were mainstream, but for example webserial is absolutely horrible to use.
Function callbacks are the best, though I wish JS would support function scheduling.
- dimgl 5y agoWho actually thinks like this? Callbacks were absolutely unmaintainable. Promises (and `async/await`) are really not that hard.
- emilfihlman 5y agoUnmaintainable? Promises make the most horrible spaghetti code there is. It is hard to read, hard to maintain and hard to reason about. Callbacks are super simple and clear, both as an api and how data is passed.
- beebeepka 5y agoIt's funny you say this because I have been promisifying xhr for years until fetch came along. And these days I do the same when I want to simplify WebWorker communication. Promises are great