This episode had everything I love about FunFunFunction - COFFEE, antics, and the usage of refactoring the same function multiple ways to illustrate concepts. I'm excited that you're going to be investing more time in your channel!
11:47 "result" is not an array of urls. it is a promise that will resolve to an array of urls. 20:13 the "await" before "Promise.all" seems unnecessary since "await Promise.all" resolves to the url array, but the "fetchCatAvatars" async function will wrap the url array with a new promise after return. Instead, without the await, the "fetchCatAvatars" async function will just return a promise that mirrors the promise returned by "Promise.all".
Man!!. I'm using async await for about an year but still your video gives me a stronger understanding of async await. Would love to see you again in this channel.
Hi, you’re very nice and funny, but I found you extremely clear and easy to follow. Moreover learning smiling is the best way! You’re unique! Very good job!
MPJ!!!! You Rock! Glad you are back! We ALL missed you! I go back and watch your old vids as refreshers on different topics. You make code fun! Keep up the great work and you know... I LOVED the opening! (and I am way high on the OCD spectrum! ) Cant WAIT to see the next installment!
Oh and by the way.. yes I will DEF be keeping a sharp eye out on Friday! Best of luck in making this a full time gig! I totally think this is a worth while cause. Again, Dude, you make code fun!
Hey MPJ, love your videos. Very absorbing, concise, and entertaining. I've been coding JS professionally since 2012, and watching this series is helping renew my passion for the language. Keep up the great work! FYI I hit the Subscribe button right around when I heard the FFV victory music at 6:53 :-)
I'm continually impressed that you can make me laugh while educating me on programming! Your presentation and editing communicate why programming is NOT boring, which is a difficult thing to communicate to non-programmers. Well done!
This was probably my favorite episode of FunFunFunction to date! The content was presented very well, the pace was on point, and the antics were excellent comedic relief. I've watched many of your videos, but this one stood out to me as being especially well-made. To me, it had just the right amount of explanation paired with just the right amount of "stream of consciousness" programming. Thank you for your great work and I can't wait to watch more!
I missed this format of your video. Thank you for you work. I remember last summer when I was learning ES6 from your videos and then I got the job. Thank you. You probably made a big influence on my life and this is awesome.
Thank you, I just watched all 10 of your functional programming videos, they were very good. You make it a lot more interesting/bearable than other teachers I've listened to.
Was waiting for a youtube channel like this, almost did it myself but no way was going to do it like this, been watching a while, you are doing it so right! Awesome stuff...
Also worth pointing out the use of try/catch so errors can be handled if the await fails. You can still use then/catch so best to choose, which you prefer. public async getSomething() { try { const data = await this.restCall(); console.log('success', data); } catch (error) { console.log('whoops', error); } }
Great job explaining! I'm having a talk in two weeks about refactoring stuff into using async / await, and found the way you presented stuff hugely helpful =)
- Will the badge gain value as time pass ? - Will the badge assess superiority on other human beings and alike ? - Can the badge be used as virtual bottle opener ? - What other functionalities / power does the badge possess ?
Great video! I'm glad you pointed out the logical non-equivalence; else I was gearing up to leave an angry comment. Pro tip: to comment a section of code, select them (doesn't have to be perfect end-to-end selection, just the selected text has to span over those lines) with mouse, and hit Cmd + /. This is pretty standard across VSCode, Atom, Sublime etc. In fact, it works both ways - it also uncomments a selected portion, if it was previously commented like this.
That's a great tip for coding on your own. I do, however, intentionally avoid editor trickery in the videos - partly because I don't want things to go too fast, and partly because it distracts from the main topic in the sense that people wonder how I did things, and I have to do a segueway to explain the hotkey every time I use it.
Excellent as usual mpj. Thanks for teaching me Async/Await. I think the Patreon scheme is also a great way to help to sustain these quality shows. So I'm in!
Very great and intereating video, especially the part when you said "Why are you watching this video, go out and look at nature" 😂, this is why the channel name is Fun Fun Function
late AF to this but it messed w/ my head a lot that the result was resolving to an array of cats until I realized that Quokka is doing that automagically and result is still indeed a promise
Great Job MPJ! Wish my early exposure to programming were made by someone like you ; had a dead boring start many years ago which caused me years of resistance to joine this boat .. though am enjoying it now .. Cheers!
Absolutely wonderful video. Great explanation of async and await. The insanity makes it astoundingly fun super entertaining. I love that *_Teaching is the best way to learn_*
If promises seems complicated give it a tray to "plan" in js-awe library. You programatically define in one place the control flow to free from side effects the rest of your code.
Hey Npj! I think the most important think you glossed over was how async await makes error handling much more sane now. You can wrap your awaits in it's own try catch which is a super win!
Thanks for this great episode on async await. One thing I would like to know is best practices of error handling with async await. My intuition is that it is easier to catch at the end of a promise than using try/catch blocks. But I'm interested by feedbacks on this subject.
Was a tad stuck until I went to mdn's site and saw that .json() returns a promise. Not sure if you mentioned that in the video but it would have been a lot more helpful to know the return type
Dude, that Patron Announcement was the best announcement I've seen on RU-vid :D The density of info/sec is also pretty nice as well :) Hope it keeps fulfilling you for the future :)
At 20:15 on line 7, I think it’s pointless to write “return await [anyPromise]”, because you are waiting for the promise to resolve before returning its value, though the async function will return a promise anyway, so it would be the same as writing “return [anyPromise]”.
Wow MPJ, really proud about you, I'm glad that you are working more on your own things, you truly deserve it. You put out really great content mate, keep it going and congrats on the new projects :)
Excellent post as usual. I think you got the gist of async/await over pretty well. More importantly the though, is that Tales from the Loop on the bookshelf on the left? That's been on my wish list for too long.
Actually, one of the biggest pros I see with async/await over plain promises is that you can use resolved values naturally, as you can have multiple async functions sharing the same scope. On the other hand, with promises, if you have a promise chain (ordered execution) and you need to somehow reuse some resolved values in different steps of the chain, then it gets a bit ugly. Because every resolved value has it's own function scope, you would have to rely on an upper scope variable or injecting the values in an array or object to carry them down the promise chain.
Thanks! Yeah, there are lots of interesting aspects I could talk about. Error handling is really nice with async / await but in the end I decided to focus on a core concept, the videos becomes both disjointed and very very long otherwise.
Hi mmpj. Another great video. I was confused with async/await vs promises and now it's clear. Thanks and cannot wait for friday morning to get the special badge :-)
Hi Johnny! So glad that I've managed to explain it well enough, and thank you so much for your support, it really means a ton, especially at this early stage.
This if f*ng amazing. I love this video. It's explanatory, engaging, full of energy and enthusiasm, presenting the topic in a clear way - well done. I wish for more videos like this in the future : )
Hi MPJ, thanks for explaining this convoluted concept in such simple manner. Just a small suggestion regarding your videos, kindly keep them short, for example you could've broken this video into 2 parts -> part 1: Intro to async await; part 2: Real life examples of async await. What happens is most of the time a person searching for a particular concept tries to always find tldr; version of video, or shorter video in general. If I am looking at video of length 24 mins in RU-vid search I would be reluctant to watch it. It's a common human tendency I suppose. You can see many other youtubers like TheNewBoston, LearnCode etc follow this technique. Just a friendly suggestion keep up the good work brother!
Yeah, in theory this is good advice but it is REALLY hard to do. I always aim for but it's about 4000% harder than it sounds like to create write scripts with atomic segments for videos - you might notice that they don't really cleanly separate, but are kind of a gray area and it wouldn't be very natural to split it. I've also not found out a way to release them in a way that isn't terribly annoying. If I release them simultaneously, they get random order in the yt interface. If I wait and release them weekly, then they become too short for a weekly episode (we did this for the devtips series and people got really annoyed by vids being just talking, and some video just being just installing things). If I release daily for some days the schedule becomes unpredictable. Making bite-sized content that is also not bullshit demo content is really hard. Also, TBH, this video has 52k views as of writing and has done better than most of my videos so perhaps we're both overthinking it. A complicated programming concept explained in 24 minutes might not be all that bad.
Fun Fun Function considering your unique approach for meticulously explaining every nitty gritty bits whilst making the content enjoyable, I also think this approach suits you more. Thanks for taking your precious time to reply back. Last request if possible can you do a video on react fiber if possible :)
I'd never heard of Quokka before. It looked awesome in your video, so I looked it up. I'm going to install and use it. I'm stoked! Thanks for teaching me something new... yet again. :)
Hey MPJ, Why do we need to call await a second time after we await the response? The function already has paused and waited for the result of fetch. Why is there the need for a second await to get the data object? Chris
+Chrisly3ear you get the response object when you get the headers. Ie you're not guaranteed to have the body at that time. That is why response.json() returns a promise that resolves to the body instead of the actual body.
well, this was interesting and it was certainly explained very well. what I think was sort of missing though and it's not a really big thing would be the negative case (when the async function failed, => .catch). I just thought I said this because on a lot of the other async things examples that I got to see over the years only the positive case was treated, and that thing would sometimes be copy pasted by js starters into actual code