Comments
  1. RisingStack Engineering - Node.js Tutorials & ResourcesTamas Kadlecsik2/17/208 min
    2 reads1 comment
    9.0
    RisingStack Engineering - Node.js Tutorials & Resources
    2 reads
    9.0
    You must read the article before you can comment on it.
    • thorgalle
      Top reader this weekScoutScribe
      3 years ago

      A bit messy and incorrect code in the examples, but you can glean some good take-aways by comparing the pure Promise versions with async/await ones. These take-aways are key I think:

      ... As it is pretty clearly intended to be used for imperative code styles. [...] Rewriting callback-based Node.js applications

      • If you liked the good old concepts of if-else conditionals and for/while loops,
      • if you believe that a try-catch block is the way errors are meant to be handled, you will have a great time rewriting your services using async/await.

      I actually like the functional programming paradigm, which means no for-loops, no try-catch. Sometimes async/await can do things cleaner though... and mixing styles is a mess. Life is hard.