1. We are a community of readers. Join us!

    Readup is a social reading platform. No ads. No distractions. No liking or upvotes. We help you pay attention to what matters: reading.

    RisingStack Engineering - Node.js Tutorials & Resources | Tamas Kadlecsik | 2/17/20 | 8 min
    2 reads1 comment
    9.0
    RisingStack Engineering - Node.js Tutorials & Resources
    2 reads
    9.0
    You must read the article before you can post or reply.
    • thorgalle
      Scribe
      1 month 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.