This is a Better Way to Understand Recursion

Поделиться
HTML-код
  • Опубликовано: 11 май 2023
  • People often explain recursion in the form of an infinite loop. Recursion doesn't work that way; it is actually a lot like the movie Inception, and in this video, I will show you how!
    ☕️ I don’t accept paid sponsorships and I have turned off mid-video ads. You’re welcome! If you would like to support my channel see: ko-fi.com/alexhyett
    📨 Join my free weekly newsletter for advice, technology and more: newsletter.alexhyett.com
    🗺️ Backend Developer Roadmap: www.alexhyett.com/backend-dev...
    📝 Read me instead: www.alexhyett.com/recursion/
    🎓 RECOMMENDED COURSES (Use code FRIENDS10 for 10% off)
    The Complete Web Developer Course - academy.zerotomastery.io/a/af...
    The Complete Junior to Senior Web Developer Roadmap - academy.zerotomastery.io/a/af...
    Complete SQL + Databases Bootcamp - academy.zerotomastery.io/a/af...
    📚 RECOMMENDED BOOKS
    Clean Code - geni.us/5AEwj2
    Domain Driven Design - geni.us/WiR0Q0x
    Design Patterns - geni.us/5ncUt
    Developer Hegemony - geni.us/lAXy
    Pragmatic Programmer - geni.us/GfNj9
    Data Structures and Algorithms Made Easy - geni.us/sqg6kJ
    Refactoring - geni.us/ufAP0mE
    Pragmatic Thinking and Learning - geni.us/x81A
    Microservices - geni.us/8vMA
    🚀 MY FAVOURITE TOOLS
    PIA VPN - piavpn.com/AlexHyett (86% off)
    Visual Studio Code - code.visualstudio.com/
    Obsidian - obsidian.md/
    Notion - affiliate.notion.so/alexhyett
    You can check out more of my favourite tools on my website:
    www.alexhyett.com/tech/
    🔗 MY KEY LINKS
    🌍 Blog - www.alexhyett.com/
    🐘 Mastodon - social.alexhyett.com/@alex
    🧑‍💻 WHO AM I
    I’m Alex, a Software Developer and RUclips working in the UK. I make videos about software development to help developers with the skills they need to be senior developers. As well as this RUclips Channel, I also write articles on my website (alexhyett.com) as well as write a regular newsletter that contains some thoughts to help aspiring developers.
    ‼️ DISCLAIMERS
    Some of the links in this description are affiliate links, for which I get a small commission, at no extra cost to you 🙂. I appreciate you supporting my channel so I can continue providing you with free software development content!
    Use of clips from Inception (2010) is under Fair Use:
    Copyright Disclaimer under section 107 of the Copyright Act 1976, allowance is made for “fair use” for purposes such as criticism, comment, news reporting, teaching, scholarship, education and research.
    #coding #programming #developer
  • НаукаНаука

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

  • @ikroac
    @ikroac Год назад +57

    To understand recursion you need to understand recursion first 😮‍💨

    • @alexhyettdev
      @alexhyettdev  Год назад +14

      To understand recursion you need to understand recursion first 😮‍💨

    • @douglasmasho2324
      @douglasmasho2324 Год назад +7

      @@alexhyettdev To understand recursion you need to understand recursion first 😮‍💨

    • @garryanderson9831
      @garryanderson9831 Год назад +6

      @@douglasmasho2324 To understand recursion you need to understand recursion first 😮‍💨

    • @JoaoVictor-vd9fn
      @JoaoVictor-vd9fn 6 месяцев назад

      @@garryanderson9831 To understand recursion you need to understand recursion first 😮‍💨

    • @aswina646
      @aswina646 2 месяца назад +4

      ​@@alexhyettdev To understand recursion you need to understand recursion first.

  • @cruzchaps3662
    @cruzchaps3662 Месяц назад +3

    Bro gave us the inception example and i thought he was going to explain it differently, then boom fibo is back

  • @theJYC
    @theJYC 5 месяцев назад +13

    Wow, stumbled upon this video and floored by the quality of the explanation and inception analogy. Thank you so much!

    • @alexhyettdev
      @alexhyettdev  5 месяцев назад +2

      Thank you! I am glad you liked it.

  • @danieldyson2754
    @danieldyson2754 3 месяца назад +19

    In your next video, could you please explain recursion?

    • @sagarshah5341
      @sagarshah5341 Месяц назад

      In your next video, could you please explain recursion?

    • @marcusantenor793
      @marcusantenor793 Месяц назад

      @@sagarshah5341In your next video, could you please explain recursion?

    • @Shubham-fo7ug
      @Shubham-fo7ug 22 дня назад

      ​@@marcusantenor793 In your next video, could you please explain recursion?

  • @blazingguyop
    @blazingguyop 4 месяца назад +2

    The best video on recursion
    What an example 🙏
    Was stuck at why it return back (kick) later understood just thinking logically 😂
    Now everything clear 😅👌
    Btw now I get it why people call some youtubers underrated😢

  • @WiggyPineda-eg3gb
    @WiggyPineda-eg3gb 3 месяца назад +3

    thank you so much! I loved the analogy, it really helped and now I must go watch inception again. Ive had a hard time wrapping my head aroound python, I mean I ace my classes so that must mean I understand it right? it just feels like Im not getting it.

  • @weekendsonlyy3947
    @weekendsonlyy3947 4 месяца назад +3

    love the comparison to a movie, keep up the great videos!!

  • @kyomdonalddogo5775
    @kyomdonalddogo5775 3 месяца назад +2

    I dont understand recursion, esp how many times to call it or what operator to use it with. I honestly thank God for loops

  • @arpitkumar4525
    @arpitkumar4525 4 дня назад +1

    You just told the surface level information/definition. I was hoping you would help develop an intuition for recursion

  • @lauris5275
    @lauris5275 5 месяцев назад

    Im learning for some time coding, but recoursion is one of those things that Im very bad at. If you dont need to nest it in the loop its not that hard. But one you need to use it in like 2-3 loops it gets hard.

  • @sebwylleman
    @sebwylleman 8 месяцев назад +7

    Great explanation and visuals Alex 🔥

  • @kevint3522
    @kevint3522 3 месяца назад +1

    Very good quality video. It's too high level for my needs though. I need to understand what's happening on the stack and with the stack frames. Do you do anything with combinatorics? Like how to use recursion to find unique combinations of k integers from a list of n integers? I ChatGBT'd it and walked through the solution. The solution wraps a recursive call into a for loop. I can almost trace it, but it is very difficult to understand. I get the impression this is a well-known problem, but I had no prayer of solving it myself because I don't know how to think through it.

    • @deadvirgin428
      @deadvirgin428 26 дней назад

      If you want a proper answer, the first step is to stay away from webdev channels.

  • @linux_college
    @linux_college 2 месяца назад

    thanks very much simple to understand
    can you explain to us what is BacktrackingFile please

  • @selbymdaka1260
    @selbymdaka1260 Месяц назад

    Can't believed I watched 10 minutes plus of videos trying to understand this only to get it on a 4 minutes 3 seconds video😂.

  • @rain407
    @rain407 4 месяца назад

    Great video!!!

    • @rain407
      @rain407 4 месяца назад

      Great video!!

    • @rain407
      @rain407 4 месяца назад

      Great video!

  • @ladro_magro5737
    @ladro_magro5737 12 дней назад +1

    bro said ‘this is a better way to understand recursion’ and proceed not to explain anything useful

  • @kyles115
    @kyles115 Год назад +1

    Why did the programmer get stuck in a recursive loop?
    Because he wanted to see how deep the rabbit hole went, but he forgot to include a base case in his recursive function. So he just kept calling the function over and over again, each time passing in the same parameters, until his stack overflowed and his program crashed.
    But don't worry, he learned his lesson. From then on, he always made sure to include a base case in his recursive functions, and he never got stuck in an infinite loop again... at least, not until he started playing with pointers and accidentally created a memory leak.
    Ah, programming. The gift that keeps on giving, even when you wish it would just stop already.

    • @alexhyettdev
      @alexhyettdev  Год назад +1

      Loved this! There is always something to trip us up. My favourite one is debugging race conditions. They are impossible to replicate if you are stepping through code.

  • @adamsmateo2149
    @adamsmateo2149 Год назад +1

    "Don't worry, I won't spoil the movie Inception for you"
    Proceeds to spoil it for me💔

    • @alexhyettdev
      @alexhyettdev  Год назад +5

      It doesn’t spoil anything beyond what you learn in the first 10 minutes of the film. I watched it again last night. Great film even though it is 13 years old already!

  • @josephalbert.
    @josephalbert. 3 месяца назад +2

    did you mean recursion? (this was really funny haha)

  • @user-hq5en9qp5u
    @user-hq5en9qp5u 2 месяца назад

    did you mean recurions

  • @user-nd8sl7ef1y
    @user-nd8sl7ef1y 2 месяца назад

    Recursion

  • @datasciencetoday7127
    @datasciencetoday7127 5 дней назад

    stack overfflew

  • @kcnl2522
    @kcnl2522 Месяц назад

    Bro stop with the fibonnaci example, its too easy. It wont help me understand how to get the height of a node in a tree. Surprisingly i can code it but i dont understand it.

  • @aendriu514
    @aendriu514 Месяц назад

    char* understandRecursion(){
    int understood = 0;
    If(understood)
    return "finally";
    else
    return understandRecursion;
    }

    • @aendriu514
      @aendriu514 Месяц назад

      Notice that understood never becomes 1

  • @Mig440
    @Mig440 Месяц назад

    Now do corecursion 😂

  • @michaelbtw
    @michaelbtw 3 месяца назад +2

    I know you want to be fast for youtube because it's cool and edgy, but if you want people to learn from your videos, pause when you show code or equations and leave them onscreen for a few seconds so people can see what you are talking about - the human brain doesn't do well trying to read and listen at the same time.

    • @alexhyettdev
      @alexhyettdev  2 месяца назад +2

      I have tried slowing it down a bit in newer videos. It's not really about being cool and edgy (I am too old for that), I just speak faster when nervous. I am still not that comfortable talking to a camera!

  • @nathanokolo940
    @nathanokolo940 8 месяцев назад

    recursion

  • @Mohyswe
    @Mohyswe 6 месяцев назад

    That

  • @objectshowfan362
    @objectshowfan362 3 месяца назад

    ruclips.net/video/Q83nN97LVOU/видео.htmlsi=nmNVMsu6AHailDE_

  • @dijonstreak
    @dijonstreak 7 месяцев назад

    thanks for teaching. NOTHING. so i learned.....NOTHING. !! what a JOKE. !!

    • @alexhyettdev
      @alexhyettdev  7 месяцев назад +4

      Why watch a video on recursion if you already understand it?

    • @whitehh15
      @whitehh15 5 месяцев назад +4

      With a comment that dumb; it's safe to assume you're not going to understand recursion no matter how it is taught.

  • @geoschool2022
    @geoschool2022 9 месяцев назад

    Fuxk this recursion i leave programming because for this recursion. Now im doing mba 😅

    • @alexhyettdev
      @alexhyettdev  9 месяцев назад +2

      To be fair there are only a handful of times that I have put recursion to good use. You could always go back to programming once you have your MBA and start SaaS company!

  • @brookegerry5058
    @brookegerry5058 6 месяцев назад

    Great video!

  • @mwansamfula3748
    @mwansamfula3748 9 месяцев назад

    Recursion