Re:Node v8.0.0 Released
by nailer on Tuesday May 30, 2017 @05:02PM
(#14448516)
I'm just getting started with async/await (like most people I stick to LTS releases) so please forgive the lack of error handling in the demo code!
[ Parent
| on HN ]
Note that node 8.0.0 is not LTS.
Node 8.x will be an LTS release around October.
Re:Node v8.0.0 Released
by partycoder on Tuesday May 30, 2017 @05:07PM
(#14448548)
As someone who spends all day volunteering in Stack Overflow I hope people providing examples were a little bit better at emphasizing error handling.
You should see the destructive effects of bad examples there.
You're welcome to add it.
In their snippet, errors would be handled altogether on the promise you get from `getJeansAndSaveThem()`.
You don't have enough information to be outraged at the toy example.
Re:Node v8.0.0 Released
by partycoder on Wednesday May 31, 2017 @04:00AM
(#14451006)
And that's a very implicit way of handling the error. Implicit behavior is good when you are encapsulating stuff (e.g: I don't need to know about the details of internal combustion engines, just pushing on the accelerator of my car so it moves forward).
But in this case encapsulation is a leaky abstraction that just makes the diagnosing of an error more cumbersome.
Oh please. The point of the post was to illustrate the feature to those wondering "what's async/await?", error handling would be complete noise for that purpose.
Re:Node v8.0.0 Released
by partycoder on Wednesday May 31, 2017 @03:46AM
(#14450976)
I would argue with you, but I don't really have to prove you wrong.
You will eventually prove yourself wrong, since deemphasizing error handling goes wrong very quickly.