Riki Fridrich: Are promises that bad? Is Async/Await syntax the best thing there ever was?

OutreachPrague
Outreach Prague
Published in
2 min readMar 27, 2023

Riki started his talk at WebExpo2022 with: “Yes, but actually no.” Why is it so? Why does he not consider it the asynchronous programming holy grail? And what he has to say to promises?

In his talk, Riki explained how the Async/Await syntax originated and for what purposes it was meant. He discusses why it is not the best way to write asynchronous code.

Do you want to listen to the whole story? Just watch this video.

Sneak peeks at some of the takeaways:

  • Despite being intuitive, short, and concise, Async/Await syntax has its limitations. For example, you cannot write a delay function with a setTimeout.
  • Promises have methods that are not possible to replicate using Async/Await syntax, like Promise.all(), Promise.race() or Promise.allSettled().
  • The promises structure might seem confusing for junior developers as you cannot parametrise promises. Remember! You can always wrap the promise in a function and parametrise the function.
  • Promises are not perfect, though. You can use Async/Await in a loop, but you can not do that with a Promise.
  • Do not despise callbacks; they are still there :)

By the way, Riki has his way of presenting his point. He used lines of code for you to look into, so if you want to listen to Riki and see his code correctly, you can find the “Slides” in this repo.

The picture that says it all?

Are you looking for a perfect visual summary of what Riki said? It is the “evolution” chart. Even though many people believe this is the process:

The truth is out here:

--

--

OutreachPrague
Outreach Prague

Building Prague community of a US startup. Sharing news and experiences on latest technology and our life here in Prague.