Andrea Koutifaris
1 min readApr 3, 2022

--

Thanks for the article. I expected a click bait, but it turned out to be well written.

You didn't convince me and I still prefer async/await syntax.

3 thoughts:

1)

```

let prevResult = null;

for(let i=0; i<toBeSaved.length; i++){

const currentResult = await save(toBeSaved[i], prevResult);

prevResult = currentResult

}

```

The code above is harder to write with promises.

2) You don't need Promise.all in your example (even though I think it is better to use it anyway):

```

const save1 = save('userData', userData);

const save2 = save('session', sessionPrefences);

await save1

await save2

```

3) try/catch is not the same as .catch(...) because try catch catches also the synchronous errors, while the .catch(...) only catches the promise errors.

This, somehow, reinforces the fact that in some cases promises syntax is better than the await counterpart.

That said, languages evolve, and I am in favor of using the new features of a programming language.

For example I was wondering last week if the if (...) statement without curly braces is still a bad practice, since we all use formatters.

We decided, as a team, that we accept one liner if statements in case of guard conditions.

--

--

Andrea Koutifaris
Andrea Koutifaris

Responses (1)