ความคิดเห็น •

  • @t3dotgg
    @t3dotgg 2 ปีที่แล้ว +388

    Really pushing the bar for programming content man. Thank you for these efforts. So hyped for the next generation of engineers who get to grow up with stuff like this 🙏

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว +13

      ❤️

    • @michastefanski565
      @michastefanski565 ปีที่แล้ว +1

      Dying from possibilities and amount of things to learn but we are crawling up 😂

  • @aquilazyy1125
    @aquilazyy1125 2 ปีที่แล้ว +24

    The phone number vs. buzzer analogy is the best explanation I’ve ever seen on this topic

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว

      Thank you!

  • @KevinVandyTech
    @KevinVandyTech 2 ปีที่แล้ว +224

    I've used all of these patterns at some point in the past, but never fully understood the pros and cons of each pattern. Your videos are always the most clear explanations. Thank you

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว +4

      Thank you Kevin! Glad it was helpful.

    • @cool_christian92
      @cool_christian92 2 ปีที่แล้ว +5

      I totally agree with Kevin! As a Java developer leaning more on JavaScript these days, this video and especially the concept of Inversion of Control and the way you present code we’re done excellently.

    • @michastefanski565
      @michastefanski565 ปีที่แล้ว

      It is somehow heartwarming seeing an experienced dev saying that he could not understand something meanwhile i'm hitting myself everytime I can't wrap my head around

  • @frankfu1122
    @frankfu1122 4 หลายเดือนก่อน +3

    Wow that buzzer/phone example was a stellar analogy for promise/callback

    • @uidotdev
      @uidotdev 4 หลายเดือนก่อน +1

      Thank you! Glad it was helpful.

  • @hansmeyer2
    @hansmeyer2 2 ปีที่แล้ว +124

    The first time I witnessed AJAX in action was on the Microsoft Developer Network web site circa 2000. It was being used to dynamically load expanded nodes in the table of contents. I remember calling over other devs to show them and we were all trying to wrap our heads around this sorcery. What a low key way to introduce such a revolutionary thing.

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว +18

      Had to be one of the earliest use cases. Great story. Thanks for sharing!

    • @robslaney3729
      @robslaney3729 2 ปีที่แล้ว +3

      @@uidotdev Before that, IE 5.0 had the original implementation in MSXML, late 1990s.

    • @jamesparson
      @jamesparson 2 ปีที่แล้ว

      @@robslaney3729 I remember that. Data islands. IE supported tag that would be loaded with (surprise) xml

    • @MarcStober
      @MarcStober 2 ปีที่แล้ว +1

      It seemed a little disingenuous that the Google executive talk about Gmail as maybe the first AJAX application when it was invented by Microsoft. Also I remember Google Maps rather than Gmail being the AJAX app that got everyone’s attention around 2004.

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว +2

      @@MarcStober Finding high quality clips from that era is difficult. So it's less "who do I give credit to" and more "who has a useful clip that fits the narrative".

  • @terencetuhinanshu
    @terencetuhinanshu 2 ปีที่แล้ว +43

    I love the historical context presented in such a succinct way. Will definitely point all junior devs I come by to these videos to get their bearings on how we got here.

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว +1

      Means a lot. Thanks Terence!

    • @KalleJillheden
      @KalleJillheden 2 ปีที่แล้ว +5

      For additional historical context, referencing C# is good for paying respect to the language authors. They invented the async/await pattern and since then all languages have followed. It's truly a masterful pattern that joins together synchronous and asynchronous code

    • @flying-sheep
      @flying-sheep 2 ปีที่แล้ว +1

      @@KalleJillheden JavaScript has always been a bit more … amateurish than others. E.g its Promise class has problems (e.g. cancelling is not part of the API), and having map/reduce as array functions is also silly (having them on the iterator would be easier to JIT compile and also enable using them without having to convert some array-like thing like a NodeList into an array first: `document.querySelectorAll(...).iter().map(...).filter(...).toArray()` ).

  • @fyriss_
    @fyriss_ 2 ปีที่แล้ว +97

    these videos are one of the best on the whole platform, can't wait for more. It's especially great for young devs, who don't know context of some things in the past that well.

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว +1

      Thanks so much. Means a lot.

  • @pavfrang
    @pavfrang 2 ปีที่แล้ว +26

    This is one of the cases where C# was revolutionary. C# brought the async/await pattern (in 2012) almost 5 years before JavaScript implemented it (in 2017).

    • @HolyRamanRajya
      @HolyRamanRajya 2 ปีที่แล้ว

      problem is the single threaded event loop of JS makes the behavior wildly different between C# and JS.

    • @chadselph3076
      @chadselph3076 8 หลายเดือนก่อน

      Nah, F# had it in 2007; but it's really just a specialization of the do-notation in Haskell which has been around since 1998

  • @ZeniteZero
    @ZeniteZero 2 ปีที่แล้ว +1

    Holy crap, this was the clearest, most concise explanation I've found for this topic. 10/10.

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว

      So glad it was helpful. Thanks for watching!

  • @adityakachroo
    @adityakachroo 2 ปีที่แล้ว +15

    This is the best explanation of async/await. I always struggled in understanding it fully. Thanks for this amazing informative video

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว +1

      Glad it was helpful!

  • @jaykelly1729
    @jaykelly1729 2 ปีที่แล้ว +50

    I get so confused learning JS man. Async is crazy for me rn… When I started digging in to async await a couple weeks ago I somehow found myself putting callbacks in my .then() functions. The other day I was writing Promise constructors inside async functions then trying to await them 😭😭
    Learning JS I’ve found it’s less about syntax and more about concept. Knowing what you need and where. Videos like this help me organize these concepts so no matter the syntax I can always keep myself oriented in the code.
    For example, my end goal while learning async Js is to be able to refactor code from callbacks to async/await. Not through memorized syntax, but because I understand that success, failure callbacks turn in to resolve(), reject() and that the callback functions are turned to thenables. Same with going from Promise constructors to async/await.
    Sorry for long comment I’m an aspiring dev with no one to talk to about this stuff. Also if I said anything wrong please correct me. I need knowledge lol.

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว +9

      Couldn't agree more. It helps if you try to understand the bigger "Why" before you dive into the details of the syntax. Sounds like you've figured that out.

    • @HandledToaster2
      @HandledToaster2 2 ปีที่แล้ว +13

      Hey friend. Keep up the good work! I wish you the best :)

    • @rickmemmer5625
      @rickmemmer5625 2 ปีที่แล้ว +3

      "my end goal while learning async Js is to be able to refactor code from callbacks to async/await." I had a good chuckle at that -- since I was doing exactly the same thing. ;o) I've been meaning to get back to that (hence the reason I'm watching the video). I got sidetracked with other goals, and it's always a struggle in finding that balance between how far you go to try to "make up for lost time" and moving on to newer things like JS frameworks (but still practicing vanilla JS in parallel).
      For example: I'm starting a 20-week React bootcamp today. I thought about taking it last year, but I just felt I wasn't ready (and I was still deciding whether to go with Angular or React). But over the last year, I worked on things like calculators and populating grid & filtering a table. Filtering by a field is easy -- but filtering by a combination of fields, lists, option groups, etc. -- is something else entirely. Granted, you could use a 3-party grid to eliminate the hassle, but the "hassle" is the whole point -- to make it as complex as possible as a learning tool.
      I've got a glitch or two to fix, and then I'm gonna polish it up -- but the essence of it all works. That personal project just happens to be COVID data using the link below. I'm not making commentary on COVID one way or the other -- it's just data that provides a real-life example for filtering: coronavirus-19-api.herokuapp.com/countries
      Anyway, if you're interested -- I have plenty of advice to pass along if you have some questions and would like some suggestions & resources for your learning approach. And since I'm trying to keep my JS goals moving along in parallel with others, helping someone out would help me as well (especially since you're focused on something of great interest to me). And once I get this grid cleaned up fully-code commented, you're welcome to fork it from github if you like (same goes for the calculator).
      Oh, and I still haven't made up my mind on Angular vs React -- I need more experience to make up my mind (and even then, I'll keep the door open). As a learning tool to help out in a job I had where they were using AngularJS and ASP.NET MVC, I developed a personal application using those platforms (with the goal of migrating to Angular later). But I'm no longer at that company because I chewed out my manager for his sloppy work, poor customer service, and turbo-charged ego. Other than that, he was a great guy who taught me a lot. Unfortunately, he wasn't so keen on listening to others.
      Anyhoo, for various reasons -- I opted to go the React direction for now (with the aim of returning to Angular later so I can compare). And the bootcamp is a way to keep me on track (same goes for offering my help to you).
      For example: In preparing for that bootcamp, I bought a $39 course -- but instead of simply trying to plow through it, I paused after a couple of sections to practice what I've learned. I found these exercises that have been ideal for that purpose:
      coderfiles.dev/blog/reactjs-coding-exercises/
      I'm not suggesting you start doing React (or any framework) right now -- just giving you some ideas for how you approach your goals.

    • @CheekiTiki
      @CheekiTiki 2 ปีที่แล้ว

      Old Async code drives me crazy bro lol. I'm still trying to wrap my head around it.

    • @HolyRamanRajya
      @HolyRamanRajya 2 ปีที่แล้ว

      tbh before this video I had the opposite and wrong idea of async await. Async+await is forcing the execution to behave synchronously i.e. one after the other. All that and without blocking the whole browser. I guess the keywords turned out to be a bit misleading for me till now.

  • @francis_n
    @francis_n 2 ปีที่แล้ว +25

    I'm pretty confident with async Javascript but this was a great history and refresher. Well explained Tyler!

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว

      Thank you Francis! Glad you enjoyed it.

  • @sjadev
    @sjadev 2 ปีที่แล้ว +1

    These “The Story of” videos are pure gold.

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว

      Thanks Stephen!

  • @smoothbeak
    @smoothbeak 2 ปีที่แล้ว +8

    Beautiful explanation, probably the most clear and extensively explained example on this I have seen

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว +1

      Thanks for the kind words ❤️

  • @uwagideon2723
    @uwagideon2723 2 ปีที่แล้ว +13

    you always deliver awesome content

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว +1

      Thank you!

  • @fatrickwilbur1370
    @fatrickwilbur1370 2 ปีที่แล้ว +1

    These are some high quality videos, happy the algorithm recommended this channel

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว

      Thank you!

  • @pictzone
    @pictzone 2 ปีที่แล้ว +3

    This channel will blow up. Glad I found you early. Exceptional information and love your point of view on this kind of stuff.

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว +1

      Thank you so much for the kind words ❤️

  • @benjinguyen9965
    @benjinguyen9965 2 ปีที่แล้ว +41

    Damn man, you deserve yourself a hard-earned sub. Really appreciate the effort you put into these details which provides the perfect amount of detail. You're the "programmer historian" channel I've been looking for.

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว +1

      Thank so much Benji!

  • @benoitleger-derville6986
    @benoitleger-derville6986 2 ปีที่แล้ว +2

    🟡Wonderful hindsight and clear vision of technological advances.

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว

      Thank you!

  • @warkentien2
    @warkentien2 ปีที่แล้ว

    The simplicity and depth of these tutorials are second to none.
    Congratulations on the channel!

  • @prog_demos
    @prog_demos 2 ปีที่แล้ว +21

    Amazing content as always.
    I just love how it is still referred to as AJAX when mostly there's no XML to be found. One older dev I talked to simply used to call JSON XML until I corrected him. I guess it's really hard for older devs to keep track of all the changes in the front-end world.

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว +10

      Ironically, it's also hard for new devs to get why things are done they way they are (specifically around weird naming conventions).

    • @JeyDotC
      @JeyDotC 2 ปีที่แล้ว +2

      @@uidotdev yeah, some weird stuff exist for historical reasons, or because of mathematicians! :P

  • @MalikMehsi
    @MalikMehsi 2 ปีที่แล้ว +2

    That's the best video on promises I have seen so far

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว +1

      Thank you!

  • @flow7502
    @flow7502 2 ปีที่แล้ว +11

    I'm learning JS at the moment, only getting started with the async part of it. And this is just the video I needed. Everything makes so much more sense. Thanks a lot for this. Liked and subbed.

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว +3

      Glad it was helpful!

  • @VE5ETA
    @VE5ETA 2 ปีที่แล้ว +2

    this is the best channel I've came across , thank you god 💘

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว

      Thanks for watching!

  • @TacoOblivion
    @TacoOblivion 2 ปีที่แล้ว +2

    Haven't seriously done web dev in 13 years and let me tell you, it's a completely different ball game now. I barely recognize JavaScript along with my outdated HTML and CSS. I don't miss it though, it was a horrible mess before and Internet Explorer 6 is no longer anyone's worry. Good job to everyone involved in pushing the technology further and thank you for this brief summary of something big that I missed.

  • @tyrodev5281
    @tyrodev5281 2 ปีที่แล้ว +3

    I adore the story telling and the occasional memes. Almost everything that's new is built upon something existing and I absolutely love the fact that you provide the whole journey of a feature, that context helps clear the abstraction with a lot of new tech that we just use without really understanding the depths of it and why should we use it.

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว

      So glad it was helpful. Thanks for watching!

  • @johng3222
    @johng3222 2 ปีที่แล้ว +1

    This is the most incredibly entertaining programming video I've ever seen

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว +1

      Glad you enjoyed it!

  • @taylorparrish4323
    @taylorparrish4323 2 ปีที่แล้ว +1

    More of these docs! As a web dev cutting my teeth in the modern era, where most things are abstracted away from you, context of where these technologies came from is invaluable.

  • @stephanschuster9106
    @stephanschuster9106 2 ปีที่แล้ว +1

    I'd be glad to see a sequel of this explaining the glory of Observables.

  • @sleros7773
    @sleros7773 2 ปีที่แล้ว +6

    Great video! Always great to learn how one tool came to existence and what is the reason behind its existence.

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว

      Thank you!

  • @HarryLowtonIT
    @HarryLowtonIT 2 ปีที่แล้ว +23

    Another awesome video! Can really tell the incredible amount of time you put into this episode🔥
    my main question to myself after watching was should I go to Denny’s? 🥞🍳

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว +4

      Thank you Harry! My only goal in life is to get restaurants to sponsor me for these. Imagine the possibilities.

    • @HarryLowtonIT
      @HarryLowtonIT 2 ปีที่แล้ว

      @@uidotdev I fully support your life goals!

  • @hv7460
    @hv7460 2 ปีที่แล้ว +2

    why is more important to me when learning new things and thanks for this.

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว

      Agree!

  • @minierparedes5177
    @minierparedes5177 2 ปีที่แล้ว +1

    This is a phenomenal "Tutorial" history lesson!

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว

      So glad you enjoyed it!

  • @macot79
    @macot79 2 ปีที่แล้ว +8

    Fantastic video! Great examples that you provide along the way, very easy to follow and grasp while you at the same time maintain a good pace.
    Already looking forward to your next video! :)

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว

      Thanks for watching!

  • @howwitty
    @howwitty 2 ปีที่แล้ว +1

    The restaurant analogy is helpful for understanding inversion of control. Thanks.

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว

      Glad it helped!

  • @TheBicPen
    @TheBicPen 2 ปีที่แล้ว +5

    Nice video! JS has a reputation for having many weird quirks, but this video just shows that with a great team behind it, a language can improve and fix some of the problems of past design. Can't wait to see what other features will be added in the future!

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว

      I agree!

  • @bozz1g
    @bozz1g 2 ปีที่แล้ว +1

    This felt like a movie, great video!

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว +1

      Thanks for watching!

  • @adamowada
    @adamowada 2 ปีที่แล้ว

    This is the best explanation of asynchronous code I've ever seen!

  • @ZiddYT
    @ZiddYT 2 ปีที่แล้ว +1

    Love this style of video, really helps get the context and a better understanding of the reason behind different kind of implementations. Hopefully you will continue this series.

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว

      Glad you enjoyed it!

  • @TheAcademik
    @TheAcademik 2 ปีที่แล้ว +2

    This video just showed up in my timeline and even though I was fairly certain I'd know all the information, but I clicked on it anyway because I'm always curious to hear what "new" voices are saying in the dev community. I was very impressed with the video production and the concise and precise explanations and thought to myself, "who is this guy." I then saw the "tylermcginnis" in the getuser example, and thought "ah yes, this all checks out."
    Keep making stuff Tyler! You've already had a massively positive impact on my career growth as a SWE, and I'm excited to see you're now on TH-cam, making your content more broadly accessible to the wider community! 👍

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว +1

      I always love comments like these. Thank you so much for all the support throughout the years. Glad I could be helpful! ❤️

    • @chebrubin
      @chebrubin 2 ปีที่แล้ว

      wasn't the first version of Outlook for the Web - a XHR dynamic desktop app like site?

  • @dionysios4714
    @dionysios4714 2 ปีที่แล้ว +1

    This was a damn good visual and conceptual analogy of Promises. Hats off to you sir.

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว

      Thank you!

  • @cinnanyan
    @cinnanyan 2 ปีที่แล้ว +13

    The one thing that JavaScript is still missing natively is the ability to handle asynchronous streams of data, which means an external library like RxJS is needed to make doing this manageable.

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว +2

      The RxJS people have been in full force in the comments 😅

    • @pizzapanni
      @pizzapanni 2 ปีที่แล้ว

      could you state an example for handling asynchronous streams of data?

    • @cinnanyan
      @cinnanyan 2 ปีที่แล้ว +1

      ​@@pizzapanni WebSocket connections

    • @OmgImAlexis
      @OmgImAlexis 2 ปีที่แล้ว +1

      @@cinnanyan look at for await you can use that with a generator that is fed by the websocket messages.

  • @SuboptimalEng
    @SuboptimalEng 2 ปีที่แล้ว +10

    JS Dev: Call me back when you get the chance
    Date: No promises

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว +1

      😩😩😩

  • @square-pixel
    @square-pixel 2 ปีที่แล้ว +2

    Fun video. One point I’d add is that async/await is built on-top of the same Promise API. Every async function returns a promise; and likewise, await operates on a promise. It’s actually possible to implement async/await-like behavior using generator functions and some glue logic to connect the Promise API-making async/await a kind of syntactic sugar.

    • @lawrencedoliveiro9104
      @lawrencedoliveiro9104 2 ปีที่แล้ว +1

      That’s sort of how Python does it. Promises/futures and the event loop are just part of the standard library (asyncio), implementable in pure Python, rather than being part of the core language.

  • @amirhosseinahmadi3706
    @amirhosseinahmadi3706 2 ปีที่แล้ว +2

    Such a phenomenal channel! Keep up the great work...

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว +1

      ❤️

  • @VerySadBatman
    @VerySadBatman 2 ปีที่แล้ว +1

    Amazing video man! I can't believe I've been missing such great content. Thank you 🙏🏾🙏🏾

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว

      So glad you enjoyed it!

  • @nuwandammikaabeysekera6049
    @nuwandammikaabeysekera6049 2 ปีที่แล้ว

    100 for creativity , and 100 for content , thank you

  • @friedpetrol
    @friedpetrol 2 ปีที่แล้ว +2

    This is a brilliant video, uidotdev. Great job mate.

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว

      Thank you! Means a lot.

  • @derickmoncado
    @derickmoncado 2 ปีที่แล้ว +1

    Outstanding man. THIS is the type of coding content I've been looking for. Absolutely destroying the like button on this one.

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว

      Ayy thank you!

  • @lonewolfcoding5208
    @lonewolfcoding5208 ปีที่แล้ว +1

    i already used this in my capstone project and because of that i graduated BSIT college
    now im continue to learn

  • @shikhar2811
    @shikhar2811 2 ปีที่แล้ว +2

    Please continue making such videos , they're great

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว +1

      We definitely will. Thanks for watching!

  • @BharadwajGiridhar
    @BharadwajGiridhar 2 ปีที่แล้ว +2

    For a guy who learned JS only from Async / Await - this is fucking amazing!

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว

      Thank you!

  • @Cyndaquil15
    @Cyndaquil15 2 ปีที่แล้ว +1

    Wish I had this video a few months ago when I was first really trying to learn about promised and async await functions in JavaScript. This video explained everything I miss understood and had to trial an error to get, as well as neatly condensed everything I did understand from probably 5-10 videos of much longer length. Can’t wait to see more content from you and definitely plan to check out your other videos

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว +1

      So glad it was helpful!

  • @ravgeetdhillon2990
    @ravgeetdhillon2990 2 ปีที่แล้ว +2

    Very well executed video! Keep up the good work. I just subscribed!

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว

      Thank you!

  • @raelindan
    @raelindan 2 ปีที่แล้ว +8

    Well thought out video, another (probably opinionated) view is that as a result of moving towards async await in javascript is that it starts to behave more like typed languages i.e. C# in which try catch is a reasonably similar thing to use with asynchronous code. Thus making it easier for devs to dabble in both language and barrier to entry to either one of the two could potentially be smaller if you already know one of the two

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว +2

      Great comment. Thanks for watching!

    • @lawrencedoliveiro9104
      @lawrencedoliveiro9104 2 ปีที่แล้ว

      try-catch is for exceptions, which JavaScript also has. But that’s an entirely separate thing.
      async/await is the resurgence of a very old CS concept called _coroutines_ , which are basically a way of avoiding threading. It’s become popular in many languages now, including Python with its asyncio framework.

  • @avi12
    @avi12 2 ปีที่แล้ว +8

    It's important to note that the downside of "await" is that it completely blocks the thread
    If you find yourself needing to call two or more Promises that do not depend on each other, you better off:
    const [value1, value2] = await Promise.all([promise1, promise2]);

    • @pictzone
      @pictzone 2 ปีที่แล้ว

      That's a really good remark. Thanks for sharing it

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว

      👍

    • @peterd788
      @peterd788 2 ปีที่แล้ว

      True but a language in itself cannot determine the existence of or lack of dependency so dealing with it is left to the programmer. This is why in C# the mixing of async with the TPL is a developer choice to be tailored to the problem at hand.

    • @alexandernordstrom1617
      @alexandernordstrom1617 2 ปีที่แล้ว

      But wait! There is more down that rabbit hole.
      - Use Promise.all if you need multiple promises to resolve successfully before proceeding and treat any rejected promise by immediately returning a rejection at the top level.
      - Use Promise.allSettled to wait for promises to either resolve or reject. This never rejects at the top level. It resolves to an array of {status, value} objects, so you can check the status of each promise and handle the outcomes.
      - Use Promise.any if you can proceed as soon as one of the promises succeeds. This will reject at the top level if all individual promises are rejected.
      - Use Promise.race to proceed as soon as the first promise resolves or rejects. This will resolve or reject depending on the outcome of the first settled promise.

  • @JacoblBroughton
    @JacoblBroughton 2 ปีที่แล้ว +2

    Here before 100k, i love these history / explanatory videos

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว

      Ayyy ❤️❤️❤️

  • @TechDiffuse
    @TechDiffuse 2 ปีที่แล้ว +1

    That is some great content. You surely deserve many more subs and views! Looking forward to more videos!

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว

      ❤️

  • @brett84c
    @brett84c 2 ปีที่แล้ว +1

    Great video. Super easy to follow and very informative while also being engaging.

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว

      Thank you!

  • @aliplaysgtr
    @aliplaysgtr 8 หลายเดือนก่อน

    Extremely clear explanations, subscribed !

  • @astronemir
    @astronemir 2 ปีที่แล้ว +1

    This is actually interesting not just for js but super well made,
    Thanks. So good that I’m watching again to absorb

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว

      Thank you!

  • @wlockuz4467
    @wlockuz4467 2 ปีที่แล้ว

    I have never thought of Promises as eliminating inversion of control, pretty cool detail!

  • @youpele5226
    @youpele5226 2 ปีที่แล้ว +1

    Amazing content, informative as well as entertaining. Your analogies are on point.

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว +1

      Much appreciated!

  • @orozcoapaza1660
    @orozcoapaza1660 2 ปีที่แล้ว +1

    Man those examples are amazing.... very clear...

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว

      Thanks for watching!

  • @olivermontalvan1416
    @olivermontalvan1416 ปีที่แล้ว

    I'm so glad I found this channel!

  • @EmilYOo0
    @EmilYOo0 2 ปีที่แล้ว +1

    subbing.. that promise analogy was amazing.

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว

      Thank you!

  • @jamespotts8372
    @jamespotts8372 2 ปีที่แล้ว +1

    Excellent content. Thank you. 🙏

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว

      Thanks for watching!

  • @johnmcway6120
    @johnmcway6120 2 ปีที่แล้ว +1

    I'm a backend dev only learning about these amazing and powerful tools. It's pretty great

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว

      Glad you enjoyed it!

  • @puyamoayer8214
    @puyamoayer8214 2 ปีที่แล้ว +1

    Oi, where was this 3 years ago when I needed it 😭

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว

      Thanks for watching!

  • @tomraaff4576
    @tomraaff4576 2 ปีที่แล้ว +2

    First time I hear a valid argument for async/await over .then() / .catch()... Thank you!

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว

      Glad you enjoyed it!

    • @gabiold
      @gabiold 2 ปีที่แล้ว

      I don't know... Why don't catch errors where it occured? The gigantic catch block where all exceptions fall in, and you don't know what caused the problem never made sense to me...

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว

      @@gabiold You can still use .catch on individual await calls if you want (since they return a promise).

    • @gabiold
      @gabiold 2 ปีที่แล้ว

      @@uidotdev Ye, but what's the point then... Await takes away the async nature of the calls and blocks instead. It's not an evolved way to write code, just a possibility to avoid dealing with Promises if we don't need asynchronity.
      Prqctically it just turns a Promise into a function call as if it were ended with a
      while (!completed) continue;
      wait loop.
      If you really need asynchronity in the callee, you still have to write .then() calls.

    • @gabiold
      @gabiold 2 ปีที่แล้ว

      ...and catching the error in the Promise in the first await will not trigger a higher level try/catch block, so it will not jump out of the execution of the block and continues with the second await call.
      This is usually not what one wants, when the calls depend on each other.
      In my opinion the .then() syntax does not decrase readability making harder to follow. Rather the opposite: it clearly signifies dependency, it is seen when something will be executed in the chain, you can see that there is a dependency chain even, not just a series of function calls below each other.

  • @MickenCZProfi
    @MickenCZProfi 2 ปีที่แล้ว +3

    This is awesome! Defo saving this for later.

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว

      Thank you!

  • @BishalUdash
    @BishalUdash 2 ปีที่แล้ว +1

    The explanation is beautiful, you've earned a new sub 👍

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว

      Welcome!

  • @mohtashimali581
    @mohtashimali581 2 ปีที่แล้ว +1

    keeping making this kind of videos and also try to make another kind of videos too. So that I dont get bored.

  • @navidmafi
    @navidmafi 2 ปีที่แล้ว +1

    your videos are amazing and professional, it's a shame that some newer generation of "programmers" are learning e.g. react without even understanding fundamentals. i hope your channel get a lot more attention.

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว

      Thank you!

  • @duramirez
    @duramirez 2 ปีที่แล้ว +2

    I always found promise to be a freaking mess, and I was always like "bruh, why don't just do async/await already, duuuuh." hehe they finally got the message :p

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว +2

      Thanks for watching!

  • @Dygear
    @Dygear 2 ปีที่แล้ว +1

    Excellent explanation!

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว +1

      Thanks for watching!

  • @mahmoodahmed7828
    @mahmoodahmed7828 2 ปีที่แล้ว +1

    Simply remarkable! 😍

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว

      Thanks for watching!

  • @ariffaysal9458
    @ariffaysal9458 2 ปีที่แล้ว +1

    this is the best explanation out there 💯👌

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว

      Thank you!

  • @blu3_enjoy
    @blu3_enjoy 2 ปีที่แล้ว +1

    Fantastic work

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว

      Thank you!

  • @joshuabharathi706
    @joshuabharathi706 2 ปีที่แล้ว +2

    i misread 52k subs as 520k subs lol. underrated channel

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว

      One day!

  • @BrunoOliveira-tj5xw
    @BrunoOliveira-tj5xw ปีที่แล้ว

    Great vídeo! Saved as part of my theory material. Subscribed

  • @CodeSketched
    @CodeSketched 2 ปีที่แล้ว +1

    These videos are on another level! I wonder how much time it takes per video to make it so slick?

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว +1

      This one was 3 weeks of ~50 hour weeks.

    • @CodeSketched
      @CodeSketched 2 ปีที่แล้ว

      @@uidotdev 😲 Thanks a lot for taking all that pain for the quality content 🙌🏽
      I'm sticking with transition-less animations on my channel for now 🙈

  • @Christobanistan
    @Christobanistan 2 ปีที่แล้ว +1

    Promises are just Tasks from the .Net Task Parallel Library, and async/await are from C#, utilizing them the same way. Microsoft was on the committee, obviously. ;)

  • @malkitsingh01
    @malkitsingh01 2 ปีที่แล้ว +1

    Simply amazing!

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว

      Thank you!

  • @coreyleelarson
    @coreyleelarson 2 ปีที่แล้ว +2

    Loving this series!

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว

      Thanks for watching!

  • @jan_Sanku
    @jan_Sanku 2 ปีที่แล้ว

    JS is very easy... until you hear about this stuff. Good thing we got this video

  • @sumitwadhwa8823
    @sumitwadhwa8823 2 ปีที่แล้ว +2

    async...await may look like they blocking the main execution thread but they're just syntactic sugars for promise chaining.

  • @ЂорђеЈеленковић
    @ЂорђеЈеленковић 2 ปีที่แล้ว +4

    Great video like always, give us some more! :)

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว +1

      Working on it! ❤️

    • @ЂорђеЈеленковић
      @ЂорђеЈеленковић 2 ปีที่แล้ว +1

      @@uidotdev I have no doubt, a big greeting from Serbia and just keep it up! :)

  • @elenangocam
    @elenangocam 2 ปีที่แล้ว +1

    You deserve my subscription for this!!

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว

      Welcome!

  • @cmilkau
    @cmilkau 2 ปีที่แล้ว +1

    Await is almost as powerful as continuation passing. And it's just amazing for readability, from inside it looks like a simple callback to fill the missing bits, but from outside you can use the implemented parts as if THEY were simple calls. So by this turning-a-call-into-a-hidden-return you can stitch control flows together with unprecedented freedom, while maintaining full readability and modularity.

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว

      Great comment. Thanks for watching!

  • @lawrencedoliveiro9104
    @lawrencedoliveiro9104 2 ปีที่แล้ว +1

    9:07 The issue isn’t the difficulty of adding new features to JavaScript, it has more to do with the overhead of those features. Here we want to add a coroutine feature. The traditional way coroutines were implemented allows preemption to occur inside any function call. This means each coroutine “thread” needs its own full stack, just like you have with multithreading. This is called “stackful” coroutines.
    The way JavaScript, Python and other languages do it, with the async/await keywords, is called “stackless”. What that really means is, because preemption can only occur on explicit “await” calls, and these are only allowed in the bodies of “async” functions, only a small amount of stack data needs to be switched when preemption happens.

  • @aayush_karna
    @aayush_karna 2 ปีที่แล้ว +1

    goddamn his voice is super pleasing to hear

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว

      Thank you!

  • @elgalas
    @elgalas 2 ปีที่แล้ว +1

    Try/catch towers of hell are also a thing.
    I think knowing all three patterns is a must.
    For example, code that is not sequential, but rather forks, might be better encapsulated inside an API, which takes callbacks for each possible fork, of course that it self has its issues, though it applies only for certain cases, but at least it helps keeping things declarative without creating special return types for every fork.

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว

      I agree!

  • @moonandsun4955
    @moonandsun4955 2 ปีที่แล้ว +1

    👨‍💻👌 awesome video bro

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว

      Thank you!

  • @bhagyashingale5663
    @bhagyashingale5663 2 ปีที่แล้ว +2

    Fireship style loving it!

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว +1

      Jeff is the 🐐

  • @anncascarano8589
    @anncascarano8589 2 ปีที่แล้ว +1

    This is a gem.

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว

      Thank you!

  • @aleksander5298
    @aleksander5298 2 ปีที่แล้ว +1

    Great video :) I would add information about the generator function that is used by async function under the hood

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว +1

      Thanks for watching! Debated that but ended up keeping it out.

  • @martinasdf4056
    @martinasdf4056 2 ปีที่แล้ว +3

    another banger from uidotdev

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว

      ❤️

  • @Nonsense116
    @Nonsense116 2 ปีที่แล้ว +1

    Great content! Just subscribed!

    • @Nonsense116
      @Nonsense116 2 ปีที่แล้ว

      I almost exclusively use .then and .catch when working with promises. In fact it always felt like "dirty" code to me whenever I saw async await. This was really good to see how someone would use async/await in a way that increases simplicity and "cleanliness".

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว

      Thank you!

  • @bhaskardixit1564
    @bhaskardixit1564 2 ปีที่แล้ว +1

    Keep posting more videos 😀

    • @uidotdev
      @uidotdev 2 ปีที่แล้ว

      Working on it!