Asynchronous Vs Synchronous Programming

แชร์
ฝัง
  • เผยแพร่เมื่อ 12 พ.ย. 2024

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

  • @nathalierautell5259
    @nathalierautell5259 4 ปีที่แล้ว +193

    I love that you are straight to the point with a clear and short explanation. It makes things a lot easier. Appreciated! 🤩

    • @vegeta4614
      @vegeta4614 3 ปีที่แล้ว

      u just want him to blow your back out

    • @gokulnaathb2627
      @gokulnaathb2627 3 ปีที่แล้ว

      Yes😀

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

    Nice explanation, but just to add even if you put setTimeOut 0ms it will still excecute last after all synchronus code is done and stack is empty. Thats because async funtions appear on the stack at call time and are immediately pushed off and added to webapis stack where count down begins and since its 0 so the callback of setTimeout gets immediately it gets pushed to task queue ( not call stack ), where spinning event loop is gonna pop this callback function on the main stack once its empty. So even if you have 5 set time outs with 0 ms and 1 console log at the end set timeouts gonna run after console.log because as i mentioned above async functions are pushed back on stack only after main stack is empty

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

      lucid explanation, thanks man

  • @billynovrando9383
    @billynovrando9383 4 ปีที่แล้ว +64

    "Not every single function that takes an argument is asynchronous, but in general, most function that takes function argument are going to be asynchronous"
    Thank you, this line clears things for me. Much appreciated

  • @srikanthathikari9995
    @srikanthathikari9995 3 ปีที่แล้ว +11

    100% crystal clear explanation. I was looking at videos that are lengthy, I could not get my head around them. Really liked the way you explained async with then example. Thanks tons.

  • @richardwalters9249
    @richardwalters9249 4 ปีที่แล้ว +94

    seems that, if you get things confused, you can replace synchronous with the word "sequential"execution ... and asynchronous with "parallel" execution. Which type blocks will also become clear as well.

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

      My good sir, that's such a great way to summarize it

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

      @@GerardBeaubrun Not quite. JavaScript isn't parallel as it is runs as a single threaded process. For asynchronous functions is uses an event loop.

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

      @@datboijdope exactly

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

      ​@@datboijdope smart man

  • @queenscript
    @queenscript 3 ปีที่แล้ว +20

    Wow, as someone who feels more intermediate than total beginner, I felt that you really validated my learning curve. Thank you!

  • @jthomasaurus
    @jthomasaurus 4 ปีที่แล้ว +8

    Always a great resource for me, short and full of relevant info. Plus I like the clicky keyboard sounds. Awesome video, yet again! Thanks, Kyle!

    • @raaghavendrahm4883
      @raaghavendrahm4883 3 ปีที่แล้ว

      I totally agree. Especially the clicky keyboard part!

  • @saritadas7716
    @saritadas7716 4 ปีที่แล้ว +5

    every single video from your channel clears so many concepts in my head, i cant even start to tell you..thank you so much from the core of my heart

  • @kimkim-bm8he
    @kimkim-bm8he ปีที่แล้ว

    you are the best youtube web dev creator. Love the show. My tip is that instead of having to type console.log() each time. Just type log and vscode will auto complete the code for you. THanks for the video

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

    I am a big big fan of your short & crisp concept clearing videos 🧡🧡🧡

  • @chienhsiang-hung
    @chienhsiang-hung 2 ปีที่แล้ว

    the best explaination of the async feature in js ever

  • @hozay6552
    @hozay6552 5 ปีที่แล้ว +28

    Short and helpful, thank you very much! =]

  • @pds7890
    @pds7890 4 ปีที่แล้ว

    I searched and searched, nothing helped me...and on top of that, those things made me confused :(, but you just made it soo easy for me!!!! Thank you! subbed!

  • @shanibburney8290
    @shanibburney8290 4 ปีที่แล้ว

    Thanks alot. I have learned promises callbacks and async await but still I was confused between async and sync terms. Your example completely cleared all concepts async JS.

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

    Your videos are straight to the point and that just amazing. Thank you for making them.

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

    Keep it simple and objective just as you are. You clarify the web dev in a way its much easier to learn. For a non native english speaker, your chanel is one of my favorite learning resource. Thank you very much and my best reggards from Brazil. (:

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

    Thank you for getting to the point, and explaining this concept in clearest possible terms.

  • @AmitKumar-ix3kq
    @AmitKumar-ix3kq 3 ปีที่แล้ว

    Simple , Short , Concise. Thank You.

  • @BadalKumar-pi7ud
    @BadalKumar-pi7ud 2 ปีที่แล้ว

    Spot On. The way you explained everything so easily. it is appreciable.

  • @Pareshbpatel
    @Pareshbpatel 3 ปีที่แล้ว

    Short, clear video on Async Programming. Thanks.
    {2021-07-20}

  • @camilaaguileras7672
    @camilaaguileras7672 3 ปีที่แล้ว

    It took me watching 4 videos until I found this one. It was perfect!

  • @jarryingnaut
    @jarryingnaut 4 ปีที่แล้ว +3

    You have explained the concept so well! Thank you : )

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

    I love your keyboard sound whenever you typed which makes me motivated.

  • @PlayinWithGhosts
    @PlayinWithGhosts 3 ปีที่แล้ว +4

    Such a simple and effective way to explain this. 🤙🏻🖤

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

    The best in explaining stuff.......big ups man

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

    Wow very straight to the point.... Awesome! Double thumbs up

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

    Love all of your videos! You make everything so easy to understand! Thank you!!

  • @Ari-pq4db
    @Ari-pq4db 9 หลายเดือนก่อน

    Thank You sir , You have cleared the doubts that were blowing my head ❤

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

    thank you brother!! very well explained!! keep it coming!!

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

    Whaaat, didnot know of this before your video. Thank you very much for sharing this

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

    Explained wonderfully 🙏

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

    Dude, you just gave the best start to learn more about Async Programming.
    btw, whats your VS code theme, font, setup...

  • @himbary
    @himbary 4 ปีที่แล้ว +3

    Love your newsletter

  • @juanandrescastillofuenmayo6619
    @juanandrescastillofuenmayo6619 3 ปีที่แล้ว

    Killer explanation, you made some stuff clearer for me in no time.

  • @mike_vahemoubayed8099
    @mike_vahemoubayed8099 4 ปีที่แล้ว

    Wooooow I couldn’t understand the difference between synchronous and asynchronous code until a I watched his video thank you!

  • @soniachh123
    @soniachh123 3 ปีที่แล้ว

    pretty clear and straightforward explanation ..... Thanks !!

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

    This is how good teachers teach. Thanks a lot

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

    Thanks, your clear explanation helped me understand this concept better. :)

  • @rajeshrathore3751
    @rajeshrathore3751 5 ปีที่แล้ว +8

    Thank you it's really helpful for me.

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

    Very straightforward I wonder why they're not just teaching like that in schools

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

    Thanks sir. It was really simple explanation!

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

    very clear explanation, good examples
    thank you man 👌👌👌

  • @hembhagat742
    @hembhagat742 3 ปีที่แล้ว

    Very good explanation of the concept.

  • @johnrafaellim3200
    @johnrafaellim3200 3 ปีที่แล้ว

    Very straightforward explanation thank you and godbless you.

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

    Thank you ! Learned a lot in just 7 minutes !

  • @technosoid2821
    @technosoid2821 3 ปีที่แล้ว

    Thank you so much, This tutorial helped me a lot to get the concept clear.

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

    Awesome! Thanks for this video.. You have explained the concepts very well

  • @pamintuanjohnjosuahm.2492
    @pamintuanjohnjosuahm.2492 ปีที่แล้ว

    Thank you, Kyle!

  • @divyanshukumar813
    @divyanshukumar813 3 ปีที่แล้ว

    Nice explanation. Simple and clear!!

  • @sidlife365
    @sidlife365 4 ปีที่แล้ว

    Well explained! Best I have seen.

  • @useruser-bv1ej
    @useruser-bv1ej 3 ปีที่แล้ว

    Thanks, The first video that helped me!

  • @bullz3718
    @bullz3718 3 ปีที่แล้ว

    Brilliantly explained!

  • @kenrosenberg8835
    @kenrosenberg8835 3 ปีที่แล้ว

    Alas! I found one great example of what Async really is.

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

    thanks for the video Kyle

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

    THANK YOU!! FINALLY SOMEONE

  • @aushafy
    @aushafy 3 ปีที่แล้ว

    Helpful and very very clear

  • @MauriceLacerda0
    @MauriceLacerda0 4 ปีที่แล้ว

    This was very helpful Kyle, thank you!

  • @alexandercuartas830
    @alexandercuartas830 4 ปีที่แล้ว

    Thanks a lot, I really tapped into the concept

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

    Very well explained

  • @harshgupta2283
    @harshgupta2283 4 ปีที่แล้ว

    excellent video mate! Really helpful!

  • @effdimusic
    @effdimusic 5 หลายเดือนก่อน

    great explanation. thanks!!

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

    Thank you. Good video, very clear.

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

    Awesome explanation!!!!

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

    Thank You So Much Brother.......🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻

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

    Thank you for the explanation

  • @indikarange2495
    @indikarange2495 3 ปีที่แล้ว

    Very good explanation

  • @solomon2291
    @solomon2291 4 ปีที่แล้ว

    Thank you man ! That was very helpful

  • @kakao3088
    @kakao3088 3 ปีที่แล้ว

    Thanks for the video, i can get more understanding about async js 👍

  • @rohitkudalkar92
    @rohitkudalkar92 5 ปีที่แล้ว

    thanks, bro you have clear this concept abut sync and async with nice example

  • @navekeinan
    @navekeinan 4 ปีที่แล้ว

    Very good explaination

  • @ritikpal9835
    @ritikpal9835 4 ปีที่แล้ว

    Thank you very much it was concise and helpful

  • @syedarmaghanhassan4652
    @syedarmaghanhassan4652 3 ปีที่แล้ว

    Hey Kail. At 6:33, I think what you were trying to say was: Every asynchronous function takes a function argument, but not every function that does so is asynchronous.
    You actually said the second part in two ways.
    Can you please tell us more about promise and fetch functions: I really did not get it with this video. Thanks !

    • @zathkal4004
      @zathkal4004 3 ปีที่แล้ว

      A promise operates in an async manner by default thereby it wait till all the data is fetched in the .then function....
      Its similar to using async and await in a fetch method (typical synthetic sugar)

  • @abderahmaneaoufi
    @abderahmaneaoufi 3 ปีที่แล้ว

    Thank you i love the way you explain things .

  • @gokulnaathb2627
    @gokulnaathb2627 3 ปีที่แล้ว

    Thank you so much, this was helpful

  • @DivineInspiration-d2p
    @DivineInspiration-d2p 2 ปีที่แล้ว

    great explanation thanks!

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

    Thank you ive been confused

  • @luisvaldez9545
    @luisvaldez9545 4 ปีที่แล้ว

    Great video man! You helped a lot.

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

    clear and concise

  • @niki6399
    @niki6399 4 ปีที่แล้ว

    thank you for this great explanation

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

    So why does
    let res = await fetch()
    console.log(“a”)
    console.log(res)
    Result in synchronous blocking code?

  • @yasharkavoosian5169
    @yasharkavoosian5169 3 ปีที่แล้ว

    Thanks I got a clear understanding about asynchronous programing :-)

  • @thesue112-v2r
    @thesue112-v2r 3 ปีที่แล้ว

    I’ve noticed a guitar in the background in your videos. Did you make the intro riff :P

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

    Isnt 06:00 supposed to print a value to be 1 since it is inside a closure function which is stored at the memory with the value of (a) which was 1 at the time the execution saw the closure function and stored it in memory ?

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

    well explained👍👍

  • @balaganesh3440
    @balaganesh3440 4 ปีที่แล้ว

    Short and sweet!💯

  • @RedEyedJedi
    @RedEyedJedi 4 ปีที่แล้ว +5

    Asynchronous code won't execute until the call stack is empty. So you you set a setTimeout function to run with 1ms but then called a function that did a lot of work, the code inside the setTimeout function won't run until the other function was popped off the call stack even though more than 1ms would have already passed. Technically JavaScript is a synchronous language with only 1 thread but it has some clever ways of emulating multi-threaded programming.

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

      Even if you make it 0ms what you said is true

  • @nguyentranconghuy6965
    @nguyentranconghuy6965 3 ปีที่แล้ว

    nicely done, thank you!

  • @ThePassportPapi
    @ThePassportPapi 4 ปีที่แล้ว

    very good explanation

  • @mitch7w
    @mitch7w 4 ปีที่แล้ว

    Thank you! This makes a lot of sense

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

    Great video, great concepts!

  • @Richard.halabi
    @Richard.halabi 3 ปีที่แล้ว

    thanks for the concept you know to explain thanks.

  • @moizkhalid2714
    @moizkhalid2714 4 ปีที่แล้ว

    Your videos are so ... I am lost the words wonderful.

  • @willgale7187
    @willgale7187 4 ปีที่แล้ว

    awesome explanation

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

    Describing Javascript execution as multi-threaded (as at 1:15) is a bad idea and teaches the wrong mental model. Look up concepts like run to completion, event loop, call stack to understand what's going on better. For example, in the setTimeout call, even if you put the delay to 0 instead of 100 it will still print 10. If you understand the concepts I mentioned you will know why.

  • @mortenlund1418
    @mortenlund1418 4 ปีที่แล้ว

    Thanks for a great video.

  • @bishbish9111
    @bishbish9111 4 ปีที่แล้ว

    Great explanetion, thanks.

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

    Wow! Thanks 💙
    You gained a sub

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

    So clear thank u

  • @dudeimadolphin4318
    @dudeimadolphin4318 5 ปีที่แล้ว

    thanks man i was always confused about that

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

    Thank you very much :)