16.16: try / catch with Promises - Topics of JavaScript/ES6

Поделиться
HTML-код
  • Опубликовано: 4 ноя 2024

Комментарии • 48

  • @cyri11e
    @cyri11e 6 лет назад +8

    Great, crystal clear as usual and so fun, it’s really a pleasure to learn with you

  • @srinivasagupta6124
    @srinivasagupta6124 4 года назад

    Excellent tutorial. It is very easy to understand JS Promises by watching your videos witch some good examples.
    Not seen anyone the way Daniel enjoys his teaching.
    Thank you.

  • @benjaminschultz6501
    @benjaminschultz6501 2 года назад

    Top notch, Daniel!! Thank you so much. This series cleared up a lot about promises for me.

  • @LittleRainGames
    @LittleRainGames 6 лет назад +9

    Try and catch is really good for server and database operations, like when you try to connect or grab data. Stuff that is out of your control and has a chance of throwing errors no matter what. So ya, pretty much exactly what you're doing. In these situations you can never use them too much.
    I came here to see what a promise is, didnt really get my answer though.

  • @orangus01
    @orangus01 5 лет назад +6

    At 5:00 I think you were going for *if (!(results[i].img === null))*

  • @jakema4o
    @jakema4o 3 года назад +1

    Promises was second confusing thing for me after recursion. Now I got one, I feel so powerfull now.

  • @koopa9815
    @koopa9815 2 года назад +1

    Correct and forgive me if I'm wrong - but is the try/catch even necessary in this use case? Try/catch is used to catch errors, including those you might not expect. In this case, the error we are preparing for is if:
    results[ i ].image === null.
    But we handle that in the .then block by just not drawing the image if that happens, thus avoiding the problem altogether? I might be misunderstanding

  • @ericzorn3735
    @ericzorn3735 6 лет назад +1

    I always love the videos because they are up beat and they always teach a lot

  • @YameenYasin
    @YameenYasin 5 лет назад +4

    the most amazing thing with your videos is i enjoy and get to laugh a lot :D

  • @thesuperiorman8342
    @thesuperiorman8342 4 года назад

    Thank you for this series on promises. It's great.

  • @Eltopshottah
    @Eltopshottah 2 года назад

    I love the coding train

  • @rampage9530
    @rampage9530 4 года назад +1

    You deserve a big like, as usual !

  • @jimmykaushal9982
    @jimmykaushal9982 2 года назад

    lol that was funny !img === null. I started laughing the moment he did that but great comeback missing on lunch. When I am doing the demo and screen sharing i can use that line lol

  • @DarrenDignam
    @DarrenDignam 6 лет назад +6

    Any good examples of when it is appropriate to use try..catch then?

    • @minciNashu
      @minciNashu 6 лет назад

      Python, C++ and C# make use of exceptions as well.

  • @andrearivera7065
    @andrearivera7065 Год назад

    Hey, new subscriber ♥ Understood you perfectly.

  • @spiraldynamics6008
    @spiraldynamics6008 3 года назад

    Best tutorials

  • @toro705
    @toro705 5 лет назад +1

    Your videos are amazing, thanks for this

  • @eduanlenine
    @eduanlenine 6 лет назад +1

    Thanks, Daniel!

  • @utkarshverma9838
    @utkarshverma9838 3 года назад +1

    Can you please share the github link for your Javscript Promises playlist's (Code implementation)

  • @网于睿
    @网于睿 2 года назад

    4:00 you can use try finally without catch

  • @leonardomra
    @leonardomra 6 лет назад

    Great videos! Thanks!

  • @owenizedd2830
    @owenizedd2830 4 года назад +2

    4:49 you know it’s always funny when you watch tutorial where the guy has excellent understanding of development but they still make this kind of mistakes 😂

  • @anthonytsang1961
    @anthonytsang1961 5 лет назад

    Very nice videos. Can you talk about how to implement streams in returning promises so that I can handle promises not at once?

  • @sharpfocus9572
    @sharpfocus9572 4 года назад

    Very useful videos , your way of learning is the best !! Please post the source code of these videos my friend .

  • @gabrieljimenez6083
    @gabrieljimenez6083 6 лет назад +4

    I love this man.

    • @naut_nigel
      @naut_nigel 6 лет назад

      Gabriel Jiménez You are handsome. Do you have an IG? LMBO😂😅

  • @johnydl
    @johnydl 3 года назад

    Did you ever make any tutorials on how to have something running async and something else running at the same time (like the loading bar)
    I'm trying to run a brute force computation and draw the most recent part of that to the screen, I think I'd like the brute force to run in a loop over and over async without having to worry about the draw FPS but I'm not sure how to do this. As it stands without the async I have to put the brute force inside the draw and either the draw doesn't run at the given frame rate or the brute force is slowed (it can only do a certain number of iterations per frame)

  • @varunbhalla19
    @varunbhalla19 6 лет назад +2

    Best teacher

    • @Engineer9736
      @Engineer9736 6 лет назад

      Varun Bhalla A teacher that doesn’t know that a catch after a try is compulsory.. Sorry for being a critic, but that says something about his experience. It’s a nice man anyhow.

    • @wowatomica
      @wowatomica 6 лет назад

      @
      Richard van Pukkem
      Have you even watched other videos on this channel? Dan is a genius with tons of experience.

    • @DarrenDignam
      @DarrenDignam 6 лет назад

      Dan is the archeytypal Dunning-Kruger coder.

    • @varunbhalla19
      @varunbhalla19 6 лет назад

      We still love him

  • @kjaygopal5324
    @kjaygopal5324 6 лет назад +1

    Hey, can you let me what is a "strict mode" cuz my code is not working.

  • @Alex-rt7de
    @Alex-rt7de 3 года назад

    best ever

  • @WolfRose11
    @WolfRose11 2 года назад

    16.15 and 16.16 are out of order in the Topics of JavaScript Playlist

  • @stevealmond7460
    @stevealmond7460 6 лет назад

    Dan.. I was looking at you p5.js introduction videos, which mention the p5js ide. But does that still exits? Which ide are you using here? .. sorry if that’s a stupid question

    • @TheCodingTrain
      @TheCodingTrain  6 лет назад +1

      The IDE I reference in my intro video no longer exists, however, a new one is coming out this summer. Stay tuned! Here is my current workflow:
      ruclips.net/video/HZ4D3wDRaec/видео.html
      Also:
      sublime text: ruclips.net/video/UCHzlUiDD10/видео.html
      atom editor: ruclips.net/video/d3OcFexe9Ik/видео.html
      brackets: ruclips.net/video/nmZbhManVcY/видео.html
      codepen: ruclips.net/video/5gfUgNpS6kY/видео.html

  • @johnclifforddevera658
    @johnclifforddevera658 6 лет назад

    Can you make a topic on using RxJS observables and subscriptions? Thanks.

  • @nagalokeshkanumoori7822
    @nagalokeshkanumoori7822 6 лет назад

    Then what is the best solution for the promise.all

  • @쿼쿼
    @쿼쿼 6 лет назад

    hey guys, can you tell me where i should start watch this you tube channel as you know it has so many contents. . i want to follow this one so .. . where is point of start??

    • @TheCodingTrain
      @TheCodingTrain  6 лет назад +1

      Try either of these playlists to start from scratch!
      ruclips.net/user/shiffmanplaylists?view=50&shelf_id=14&sort=dd
      ruclips.net/user/shiffmanplaylists?view=50&shelf_id=2&sort=dd

  • @Engineer9736
    @Engineer9736 6 лет назад +15

    That try catch is a last resort is just nonsense. It’s a key aspect of object orrientated programming. If you have a function that calls a function that calls a function, and that last function produces an error, you can just say throw new exception. All the 3 layers of functions will stop running and in the top function you can catch the error. Lesson you learn from this: Don’t trust oneliner statements from random people without them mentioning a source of information.

    • @OakJIM
      @OakJIM 6 лет назад

      Than again, especially in .NET try catch will perform really shitty, so its not a use or dont use scenario. But rather that you consider when to use it so that it makes sense, rather than just sticking to the convention of black or white.

    • @nobytes2
      @nobytes2 5 лет назад +1

      I use try/catch all the time I've written lots of internal cmd utilities for the company I work for. Errors are bound to happen, is just life, a try/catch is the most sane way to let the program keep going without crashing. I think what the chat meant is that not every situation needs a try/catch, of course you can have plain exceptions but well errors can be handled a thousand different ways. Try/catch is perfectly fine for every day use, I agree is nonsense to say limit how you use them.

  • @variable_0
    @variable_0 4 года назад

    This man helps me understand promises. but can I just point out that you sounded like donald duck?

  • @ianprado1488
    @ianprado1488 6 лет назад +1

  • @driversteve9345
    @driversteve9345 6 лет назад +1

    I find that most examples online, although they demonstrate certain features and how-to wire them up, almost always they show how NOT to code in a professional way! I hardly ever see examples of exactly what professional developers would actually put into production code of the software they develop! That is severely lacking in the teaching world!
    If it's not the way you would code a professional made software yourself, then DON'T TEACH IT!!!