7 ms·
I've been using async / await since babel started out, and before that I was using co with generators. While I do agree that it's a big improvement, it sucks t
by TheAceOfHearts 10y ago
I've been using async / await since babel started out, and before that I was using co with generators.
While I do agree that it's a big improvement, it sucks to see people using try/catch for flow control. This is really a problem with Promises in general: you can't easily differentiate between exceptional behavior and failures.
After playing around with Elixir for some smaller projects, I've really been enjoying their approach: you return a tuple with :ok and the result or :error and the result. And they ALSO have exceptions, but they're not used for flow control, you only get exceptions for truly exceptional behavior.