Hacker News new | ask | show | jobs
by kaba0 998 days ago
I’m not really sure that it is all that subjective — plain old serial, blocking code is objectively easier to reason about than “jumping around” code.

It’s a different question that async-await may have a few very specialist use-cases, that is not readily available in the preemptive model.

1 comments

> blocking code is objectively easier to reason about than “jumping around” code.

This is precisely why await was introduced in the first place. Promise and callback code was impossible to reason about.

A Promise is not ordinary blocking code.

String res = someRestCall();

is.

I was agreeing with you. They introduced await because they know that

    var s = await someCall();
is way easier to reason about than:

    someCall().then(…)
Oh, I see! Sorry for the misunderstanding!