Throw, Try, Try? Try! Catch

Поділитися
Вставка
  • Опубліковано 11 вер 2024
  • Many developers, including myself are confused by the different flavors of the `try` keyword. Swift defines three variations of the `try` keyword.`try`, `try?`, `try!`
    You use the try key word when you have a function that throws. What the heck does that mean?
    If you are like me, and confused as to what throw means and which flavour of try to use and why, then keep watching this video. Hopefully, I will be able so shed some light.
    Starter Projects:
    www.createchso...
    References:
    9 part series on JSON Parsing and Codable Protocol.
    • JSON and Codable Proto...
    Stewart Lynch's UA-cam Channel
    / stewart Lynch
    CreaTECH Solutions Website
    www.createchso...
    Stewart Lynch's GitHub
    github.com/Ste...

КОМЕНТАРІ • 32

  • @shynepo6
    @shynepo6 2 роки тому +3

    I followed your 9 part JSON series before coming here to find clarity on everything "throw, do, try, catch" related. I love how you took the time to relate these concepts to your JSON series. You have an extremely thoughtful and Pattern-Recognition-Friendly method of delivering information and interconnecting it to slowly reveal a larger framework. Thank you.

    • @StewartLynch
      @StewartLynch  2 роки тому +1

      Thank you for taking the time to provide me with this thoughtful and encouraging comment.

  • @andrejkling3886
    @andrejkling3886 3 роки тому +1

    Gratitude for Amazing content in all lessons on the Channel

  • @carlosswiftdev2703
    @carlosswiftdev2703 2 роки тому

    I always wondered why tutorials said try needed to be wrapped in a do catch and this always puzzled me and now I understand the errors are bubbled up to the top. Awesome! thank you very much

  • @srome0711
    @srome0711 2 роки тому

    Very helpful - especially the JSONdecoder info

  • @yogeshsharma8628
    @yogeshsharma8628 4 роки тому +1

    Simple way to explain things and with best examples . Thanks and keep making more videos.

  • @saifcodes
    @saifcodes 4 роки тому +4

    Great explanation with good examples. Keep it coming. Thanks for the amazing content.

  • @Mhak-rt3lu
    @Mhak-rt3lu Місяць тому

    Thank you very much.
    the last part of the video was very important, this concept of bubbling up (Propagating Errors) was confusing me and I always ended up with redundant code.

  • @arsgardisnotaplace
    @arsgardisnotaplace 2 роки тому

    Thank you for the explanation. Simple yet precise 👍👍

  • @brandonwinston
    @brandonwinston 4 роки тому

    omfg this was easily easily the best explanation of this subject. I still don't really understand why a plain "try" is customary at init, but I will check out your decoding series for more info on that.

    • @StewartLynch
      @StewartLynch  4 роки тому +1

      Slow down. You are going to go into video overload LOL

  • @KarthickKarthick-zt7vh
    @KarthickKarthick-zt7vh 4 місяці тому

    Very useful. Thanks for making this video.

  • @josuecruz0921
    @josuecruz0921 2 роки тому

    Thanks for your amazing tutorials 🙏🏽

  • @ZigBehaviour
    @ZigBehaviour 3 роки тому

    excellent attention to detail in both content and presentation style.

  • @tibettenballs4962
    @tibettenballs4962 2 роки тому

    you are a very, very good tutor.

    • @StewartLynch
      @StewartLynch  2 роки тому +1

      Glad you think so! I have been at it a very, very long time. Age makes you wiser LOL.

    • @tibettenballs4962
      @tibettenballs4962 2 роки тому

      @@StewartLynch hah. though i believe im actually stupid; i have come to realize intelligence, coupled with maladaptive idiosyncracies from youth is a huge detractor to ones growth.
      it is unfortunate: intellegence and maladaptive thought processes limits one from wisdom at a later age.
      wisdom is highly sought for; yet time is the only enumerator.
      yet, intellgence - ironically - pivots one aginst the herd, thus making him/her 'different'
      Wisdom has more value than intelligence. and intelligence without proper guidience, in effect, is an INCB aimed at ones neural synapsis.
      hence, the maladaptive processes that manifest within - though helpful at the moment - will detract from any potential wisdom to be ascertained.
      thank you for being the wise one. and thank you for taking the time out to teach myself and others the 'proper way' of coding. (YT is not the best place to learn CS, or even programming, therein making you are a unfounded gem)

  • @nicholasdimaria
    @nicholasdimaria 3 роки тому

    Excellent video! This was extremely helpful for me. I like your educational presentation style

    • @StewartLynch
      @StewartLynch  3 роки тому +1

      I am glad to hear that Nicholas. I have quite a few more coming that you may like coming up over the next few weeks.

    • @nicholasdimaria
      @nicholasdimaria 3 роки тому

      @@StewartLynch great, looking forward to checking out more of your videos! 🙂

  • @vincentjoyhere
    @vincentjoyhere 3 роки тому

    Excellent explanation! Thanks for doing this :)

  • @nenadnikolic3367
    @nenadnikolic3367 3 роки тому

    Wonderfull explanation! Great work!

  • @dr.craigcurphey4829
    @dr.craigcurphey4829 4 роки тому

    This cleared up my understanding of this whole concept. Excellent job!

  • @tibettenballs4962
    @tibettenballs4962 2 роки тому

    DOOD! make UDEMY kourses

    • @StewartLynch
      @StewartLynch  2 роки тому

      I have a couple now, but not for iOS. Way too much work and I would have to promote it. Not sure I have the audience.

    • @tibettenballs4962
      @tibettenballs4962 2 роки тому

      @@StewartLynch you def do. my discord is popular, and your personality lends to easy course within a tutelage setting. in essense, there are alot of lost, young and aspiring developers, in need of mentorship.
      my understanding of yt economics, is to move your base away from YT asap.
      as i mentioned before, you have a very affable personality, coinciding a soothing tone. You would be a great mentor to many lost developers.
      from there, you have a base upon which monitization is possible.
      believe it or not, sir. i do believe you are one of the best teachers I have come across.
      Having learned Java, python, data science, and now dropped out of high school (avid book reader and over-indulgence in CS) I must say, you make me want to go to college.
      That, in itself.. is a skill, undoubtably.
      Jokes aside, I am ingratiated to you being a part of my self-learning journey.
      Thank you, sir.