Throw, Try, Try? Try! Catch

Поделиться
HTML-код
  • Опубликовано: 13 окт 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 RUclips 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.

  • @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

  • @Mhak-rt3lu
    @Mhak-rt3lu 2 месяца назад

    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.

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

    Gratitude for Amazing content in all lessons on the Channel

  • @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.

  • @KarthickKarthick-zt7vh
    @KarthickKarthick-zt7vh 5 месяцев назад

    Very useful. Thanks for making this video.

  • @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

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

    Thank you for the explanation. Simple yet precise 👍👍

  • @saifcodes
    @saifcodes 4 года назад +4

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

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

    Thanks for your amazing tutorials 🙏🏽

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

    excellent attention to detail in both content and presentation style.

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

    Wonderfull explanation! Great work!

  • @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 :)

  • @dr.craigcurphey4829
    @dr.craigcurphey4829 4 года назад

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

  • @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)

  • @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.