HNHacker News
TopNewBestAskShowJobs

karoladamiec

9 karma · joined June 17, 2015

submissionscomments
karoladamiec··on The Final ES2015 (ES6) Draft
That is one perfectly fine way to do it. But that is exactly what i want to highlight. The generators. You can combine them with promises, callbacks, even the CSP channels. But you need the generator. That is where magic happens and no amount of library code will do that for you, one needs compiler support (or a macro...)
karoladamiec··on The Final ES2015 (ES6) Draft
Well promises help. And then they stop :). Stop helping. They just break under the weight. If you have promise chain that gets too long, you will feel the pain.

The whole thing is, when some IO returns 1 or 2. And your next step is to do a or b depending on the reply. How is your neat promise chain looking now? Then repeat 100 times :(

Not even mentioning error handling... and stack traces.

So i do agree that it depends what you do a lot. Maybe there are domains where it is not important... but i still need to see that one.

And i will take blocking IO with try/catch 10 times out of 10. Even when it is not critical. It is just nicer and easier to reason about.

karoladamiec··on The Final ES2015 (ES6) Draft
One reason to rule them all: Generator functions.

Why it is a big deal one might ask. It is the BIGGEST deal in history of Javascript in my book because it allows you to do async that looks sync. No more callback hell. It is the single most important feature, as it eliminates async issues completely. And EVERYTHING in js is async. But in reality, you want to drop into async only sometimes. Now you are forced into it 100% time, even when you need the result of async call to decide what to do next. It gets tricky really fast.