7 Design Patterns EVERY Developer Should Know

แชร์
ฝัง
  • เผยแพร่เมื่อ 6 ม.ค. 2025

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

  • @RafaeldaSilvaPeres
    @RafaeldaSilvaPeres หลายเดือนก่อน +30

    Yes YES WE LOVE ANALOGIES! Please! Best way of teaching and learning! Starting from the big picture, analogies and then down to the specifics! People seems to want to glorify knowledge sometimes by hitting with the specifics right on their face making them watch and rewatch or just give up on it, but this way u go helps alot!

  • @kopilkaiser8991
    @kopilkaiser8991 20 วันที่ผ่านมา +15

    Learning from you is a fun and engaging activity. This is how teaching should be delivered. Structured, concise, and informative 😊

  • @WestonJP88
    @WestonJP88 24 วันที่ผ่านมา +20

    I REALLY like the analogies. That's the best way for me to grasp the actual concept. Just found you on TH-cam, and I already like the content.

  • @noodlespwn42
    @noodlespwn42 หลายเดือนก่อน +16

    most of these are intuitive. it's great to formalize these concepts and this video does a great job at providing a high level overview of them. thank you

  • @ivanlawrence2
    @ivanlawrence2 หลายเดือนก่อน +13

    I love the format of your videos... I also love that in your examples of each pattern you are also reducing the nesting and using early exiting which is the opposite of what the people in the repo I'm currently in have done. My first pass for just about and change is 1st to reduce nesting, 2nd try and apply the appropriate pattern (like taking a constructor with 30 params and converting to a builder pattern, or passing in an object which implements the builder pattern, which means now I'm the lucky SoB who gets to go "fix" all the other code), 3rd weep and commit

    • @ivanlawrence2
      @ivanlawrence2 หลายเดือนก่อน +1

      Oh, and "bless your heart" hit me right in the feels... and pronouncing facade the way JFK might have done it (fah-Kay-d) is how I like to explain it ;)

  • @mykalimba
    @mykalimba 27 วันที่ผ่านมา +3

    Great explanations. I had to watch the section on the Builder pattern a few times over to make sure I didn't miss this, but I think you glossed over the most important step in how this works. The key is that each of the methods that initialize something returns the object itself (i.e. "this") as the return value, so that it's possible to chain calls to those methods as you demonstrated. An astute viewer could pause the video to see this in your code, but I think it's worth an explicitly mention.

  • @ziacodes
    @ziacodes 6 วันที่ผ่านมา +1

    I watched you since you had 20K subscribers.
    Most underrated channel. Please show more code examples. That really helps us!

  • @adria3439
    @adria3439 24 วันที่ผ่านมา +2

    Nice explanation, you have a great body language and it helps the viewer to keep watching the video

  • @vincentmontano4518
    @vincentmontano4518 24 วันที่ผ่านมา +1

    The analogies are spot on! I learned more from this video than the entire book and online tutorials combined about design pattern.

  • @hisoka500
    @hisoka500 19 วันที่ผ่านมา +1

    Bro, this is the best thing I've seen in a long time! Keep sharing content like this! 👌

  • @theteacher3163
    @theteacher3163 20 วันที่ผ่านมา +1

    loved the video! the way you describe the patterns is amazing. I'm sending this video to every coder I know. Subscribed!

  • @abzrg
    @abzrg วันที่ผ่านมา

    09:03 schtruschural pattern
    Simple and concise explanation. Thanks!

  • @KineticCode
    @KineticCode หลายเดือนก่อน +288

    To newer developers - when you learn design patterns you generally think "oh i can use this here!" in every scenario, making design patterns your hammer and every code problem a nail. In my experience as a professional developer I have never - not once - deferred to the Design Patterns book to solve a problem. Everytime I had used one in my personal projects however - it was always an imperfect fit to a similar problem. You could say "skill issue" but I'm just pointing out that you should not worry about these things before you're employed. Just make things!

    • @mattwayne9128
      @mattwayne9128 หลายเดือนก่อน +78

      Newer developers, you shouldn't be making the decision to not study software engineering concepts based off the anecdotes of anonymous TH-cam commenters.
      You will write bad code as you start off. It's inevitable. That's why you practice. Not learning this because of the nebulous idea that you might use it where it "shouldn't be used" is ridiculous.

    • @itztlacoliuhqui
      @itztlacoliuhqui หลายเดือนก่อน +18

      Yeah its not a hammer. Its like 23 different tools actually. Hammer included

    • @KineticCode
      @KineticCode หลายเดือนก่อน +9

      ​@@mattwayne9128 There's a lot of things to learn when starting. There's alot of concepts with varying usefulness with building software. The real question is what information is most applicable to getting yourself into a position where you can have good mentorship and stability in learning(employed). If you learn software dev because you're passionate about it - my comment shouldn't dissuade a single person because they'll learn these things from genuine interest (as I did!). I'm advocating for learning relevant skills rather than all skills, which in my, yes, anecdotal experience, would exclude Design Patterns. Otherwise it's easy to fall into a sea of theoretical knowledge with no idea of how to apply it practically! I appreciate your perspective btw

    • @w花b
      @w花b หลายเดือนก่อน +7

      You're not 100% wrong but I made vidéos games and at the end, I was always regretting not making the code more modular for example. It's basically spaghetti code. Design patterns won't make regrets go away but they definitely will make your life easier in the long run for projects you're supposed to build on top of or modify (anything with a long life span)

    • @barbara_993
      @barbara_993 หลายเดือนก่อน +1

      I would agree if we [in my company] we don't require knowledge about design pattern and usage before employment. I doubt that I will let someone further if they do not know what at least singleton is and how to use it.

  • @mohamedraslan3504
    @mohamedraslan3504 9 วันที่ผ่านมา

    Excellent explanation, loved it a lot, your way of explaining stuff with simple words and analogies is perfect, Thanks

  • @wiilamaral
    @wiilamaral 19 วันที่ผ่านมา

    I recently found your channel, and it’s impressive the way you explain things and make fun at the same time. This makes the learning process much better. Thank you! Subscribed 😉🧑🏽‍💻

  • @pouyababaie2159
    @pouyababaie2159 หลายเดือนก่อน +3

    This was the most easy way to understand all of these standarts. Thanks ;)

  • @another_arthur7
    @another_arthur7 11 วันที่ผ่านมา

    I like the way you explain how we can actually implement what you tell about, got a new sub

  • @CokYogaIXGXXVII
    @CokYogaIXGXXVII 22 วันที่ผ่านมา

    The only time I paused was when I liked and subscribed you, amazing video man!

  • @gavinwilliams4330
    @gavinwilliams4330 หลายเดือนก่อน +2

    Great video! I love the way you explained things and the way you demonstrated the benefits of each pattern in code.

  • @yashh7449
    @yashh7449 24 วันที่ผ่านมา

    I loved your analogies, you made it so much easier to understand these concepts! Thank you so much ❤

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

    Great refresher! Love these type of vids

  • @derivadadekonoha
    @derivadadekonoha 27 วันที่ผ่านมา

    This is the most easiest way knowing to concepts of the design patterns I've ever found. Your clean and structured way of teach gives us the only task of learn, as easy as possible. Thanks for this amazing content....

  • @abymathew575
    @abymathew575 24 วันที่ผ่านมา

    Really nice video. First you explained the concept very well, then you showed the practical implementation in codes with real scenarios. This way of video presentations are really helpful to understand the concept. Thanks for your effort and expecting more from you

  • @AmitabhSuman
    @AmitabhSuman 7 วันที่ผ่านมา

    Loved your explanation. Very interesting and simple. Tons of thanks!

  • @ianramirez1577
    @ianramirez1577 หลายเดือนก่อน +1

    I learned more from your video than in the university. Thank you and regards from México

  • @Zeraltz
    @Zeraltz 28 วันที่ผ่านมา

    Finally I understood these design patterns, you know how to explain things! subscribed

  • @KyleLuce
    @KyleLuce 6 วันที่ผ่านมา

    Some framework strategies of dependency injection can be Singleton by default and are easier to test. For example Spring Singleton beans are easy to mock since the guarantee of being Singleton isn't language enforced (it's at a higher abstraction).
    If you do singletons the old fashion way it's indeed a pain to mock any Singleton or static implementation. Kotlin does make static and its object Singletons easier to mock using Mockk, but i believe there are still some pitfalls to avoid.

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

    this is a great video! fellow java dev here. i'd love to see more java / spring boot stuff! not enough good java / spring boot influencers on YT imo

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

    This was so good. I’m sharing it with my dev team! Thank you

  • @BogdanNedelcu-b3n
    @BogdanNedelcu-b3n 14 วันที่ผ่านมา

    Great video, didn't know I was using so many patterns.

  • @ahmadiyad2860
    @ahmadiyad2860 23 วันที่ผ่านมา

    your voice like graves from call of duty thank you man for all these videos you make

  • @taofeekakinkunmi8990
    @taofeekakinkunmi8990 3 วันที่ผ่านมา

    I love the way you simply everything. kudos

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

    i was needing this this morning haha, thanks dude!

  • @Slim_dev
    @Slim_dev 11 วันที่ผ่านมา

    Great Content Man!, please create more of these videos thanks a lot!

  • @bradchellingworth5973
    @bradchellingworth5973 26 วันที่ผ่านมา

    first time viewer here, listening to this in the background and keep thinking im getting a lesson from Matthew McConaughey

  • @totollygeek
    @totollygeek 28 วันที่ผ่านมา

    Really cool video, kudos.
    I giggled when you called them “freedom units” 😂

  • @jaysonlabarrete9121
    @jaysonlabarrete9121 วันที่ผ่านมา

    I love your analogies! I subscribed to

  • @PavinWannasirilak
    @PavinWannasirilak 11 วันที่ผ่านมา +2

    18:24 Why will a lot of if-else if-else be gone? How can you know what type of the transport should be constructed without the control flow?

  • @ElHirani
    @ElHirani 27 วันที่ผ่านมา

    Thank u im new with these kind a type of things , cause i recently learn oop so this video help me a lot in any terms

  • @acrosstheocean25
    @acrosstheocean25 10 วันที่ผ่านมา +1

    A little confused on the example for the observer pattern you gave here regarding performance. You would still have to loop over however many subscribers there are in order for them to get the notification, and assuming that they are all on the same machine, the work will still be done at the same place. So I don't quite understand how there is a performance gain in this specific scenario, unless that was just an analogy for a distributed system?

  • @flyte9844
    @flyte9844 18 วันที่ผ่านมา

    Exactly what I needed to watch ! Thanks !!

  • @codeman99-dev
    @codeman99-dev หลายเดือนก่อน +18

    21:31 The notify private method is doing the wrong thing. It should be emitting an event that the subscriber can listen for. The whole point is that the acting class does not need any collection of who wants the result of the action. You emit the result.

    • @Kenny-st8cg
      @Kenny-st8cg หลายเดือนก่อน +5

      Correct, I don’t think he really understands what the observer pattern is.

    • @Valrast1
      @Valrast1 25 วันที่ผ่านมา +4

      Also, "we don't loop through"- we loop with foreach

  • @ramgopalvarma5949
    @ramgopalvarma5949 20 วันที่ผ่านมา

    Crazy simple examples to remember, I just wish you provide more code examples

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

    hey my friend, please do more videos where you just show us the code and teach it as you go. you do a great job of explaining simply!!!! thanks

  • @lautidev_
    @lautidev_ 10 วันที่ผ่านมา

    Nice video, so easy to learn

  • @mcstephen
    @mcstephen 26 วันที่ผ่านมา

    A Video i never knew i needed.
    Thanks alot, for real, thanks.

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

    Thank you!! I got exams about exactly those patterns next week!

  • @tiagodev5838
    @tiagodev5838 29 วันที่ผ่านมา

    Great instructional video, thank you!
    Also, "Freedom Units" is one of the most American things I've ever heard haha!

  • @juancriolivares
    @juancriolivares 29 วันที่ผ่านมา

    Great explanation. Beside these ones, I really like the decorator pattern.

  • @lilgox3105
    @lilgox3105 13 วันที่ผ่านมา

    You explain well the design patern...

  • @Ni7ram
    @Ni7ram หลายเดือนก่อน +4

    about subscriber pattern.. i know its useful, and the core of reactive prograaming, but I dont see the advantage in this example. i mean you say loop through users is not performant, but it ends up using a foreach, that is essentially the same.
    the thing is, i dont think it can be done without looping the array somehow
    great video as always man

    • @TVDaJa
      @TVDaJa หลายเดือนก่อน +3

      Yeah I was thinking the same thing. I always thought the big improvement it provides is de-coupling things that need to SOMETIMES exchange some data/signals

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

      I believe it would be more useful when let’s say a subscriber only wants to be notified for specific events, not all events. Perhaps a user subscribed to a channel doesn’t want to be notified a new video is released but is still a follower of the channel.

  • @celestinenwachukwu919
    @celestinenwachukwu919 18 วันที่ผ่านมา +1

    as a junior developer i felt like i peeked into heaven

  • @Alan-hf2gs
    @Alan-hf2gs 9 วันที่ผ่านมา

    Fun fact: if you can read the Gang of Four all the way through in one sitting without falling asleep, you automatically receive a FAANG job offer.

  • @Doot_00
    @Doot_00 20 วันที่ผ่านมา

    great content bro!

  • @lutfiikbalmajid3128
    @lutfiikbalmajid3128 29 วันที่ผ่านมา

    Hi, Your new subs here! i like your video, the way you explain, and some little jokes you put in this video haha

  • @WiktorWandachowicz
    @WiktorWandachowicz 27 วันที่ผ่านมา

    19:54
    "And I know this is gonna hurt some feelings.
    A lot of y'all are just 'IF ELSE-ing, IF ELSE-ing' everything. You know WHO YOU ARE!"
    Pure gold 😁🤣😂

    • @Slim_dev
      @Slim_dev 11 วันที่ผ่านมา

      😂😂

  • @alexiosgaming6504
    @alexiosgaming6504 12 วันที่ผ่านมา

    Bro this thaught me many things. Now i can too speak like i know everything about design patterns

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

    100% want you to explain everything to me 😅💜

  • @cris7775
    @cris7775 28 วันที่ผ่านมา

    Love It, great explanation

  • @ashishsapkota945
    @ashishsapkota945 หลายเดือนก่อน +2

    I came to find out that I have been using most of those patterns without knowing what they were

  • @KimHenriksen.
    @KimHenriksen. 28 วันที่ผ่านมา

    Great video!
    “I’m looking for an AI tool that can quickly translate TH-cam videos into Danish and play them with Danish speech. Ideally, it should be able to extract subtitles, translate them, and then use text-to-speech technology to provide the audio in Danish, all in sync with the video. Any recommendations or solutions would be greatly appreciated!”

  • @luan5217
    @luan5217 12 วันที่ผ่านมา

    Nice video! I would like to know what program do you use to diagram ;)

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

    6:00 oh shit! That just solved a problem I had sweet thanks

  • @parttimewarrior5789
    @parttimewarrior5789 27 วันที่ผ่านมา

    I don't know who this comment is for, but this feels like watching an Adam Ragusea video except about programming

  • @pawel_890
    @pawel_890 หลายเดือนก่อน +3

    When can we expect a video of Rust on NixOS on Neovim?

  • @NebulaM57
    @NebulaM57 26 วันที่ผ่านมา

    Freedom Units, I like that. :)

  • @deltatee9050
    @deltatee9050 10 วันที่ผ่านมา +1

    Amazing, loved the analogies, sample situations and code snippets which displayed the execution excellently!

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

    Amazing video, Thank you

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

    I clicked subscribe as soon as he said “freedom units”.

  • @ImNotAshhhhhhh
    @ImNotAshhhhhhh 27 วันที่ผ่านมา

    I feel like a lot of the issues that design patterns resolve can be fixed with simple static classes with static methods

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

    Thank you man :)

  • @Jonathan-zq8vs
    @Jonathan-zq8vs 15 วันที่ผ่านมา +1

    What are you using to diagram ?

  • @SonAyoD
    @SonAyoD 29 วันที่ผ่านมา

    fantastic video

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

    do you typically write all your JS in classes? no? would've been good to see these written in the way we write JS using closures and higher order functions.

  • @circle4106
    @circle4106 29 วันที่ผ่านมา

    Factory pattern is so much more flexible when you're able to overload the method.

    • @owenrossi-keen2594
      @owenrossi-keen2594 28 วันที่ผ่านมา +1

      Agreed, however: Typescript + object parameter makes this effectively a non issue in 99% of cases.
      There are situations where I wish TS had proper overloading though...
      One thing you can do to get around this is spread your params and type them as XOR. This is the best solution I've found for getting something that looks like Java over loading.

    • @circle4106
      @circle4106 28 วันที่ผ่านมา

      @owenrossi-keen2594 exactly answers the question i had on implementing this overloading technique on TS, coming from Java 😂. Thanks for the insight.

  • @Clma333
    @Clma333 25 วันที่ผ่านมา

    This was such an insightful video! I really enjoyed the part about design patterns . It reminded me of a video series I recently made on S3 buckets, where I dive deeper into core concept of S3 buckets like replication,storage tiers. If anyone’s interested, feel free to check it out - I’d love to hear your thoughts!

  • @codewithfelix3940
    @codewithfelix3940 หลายเดือนก่อน +1

    Had never written type script before but it looks so much like java which hv written for so long.

  • @yowremco
    @yowremco 7 วันที่ผ่านมา

    Might be stupid question. But why is this not done via functions?

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

    @ForrestKnight Kinda random but can you drop a link to your chair model? Does the seat tilt too or only the back?

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

    Is the book ok for beginners? Like me? Learning JavaScript? I read a review and it said that because it's so old and technical a noob like me would just get confused and would struggle to see how the techniques would apply to my journey learning to program. I've put it on a list either way.

  • @snowman1185-v
    @snowman1185-v หลายเดือนก่อน

    Very nice. Thanks. :)

  • @cabrelelvis
    @cabrelelvis 9 วันที่ผ่านมา

    thx for that

  • @Dr.Schnizzle
    @Dr.Schnizzle 29 วันที่ผ่านมา

    Correct me if I’m wrong, but isn’t the strategy pattern the same as polymorphism?

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

    I see that's why youtube is sending me notifications from weeks ago.

  • @narcissekabongo2616
    @narcissekabongo2616 28 วันที่ผ่านมา

    which vscode theme are you using brother?

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

    Would you still use the adapter pattern if you only accessed the slightly wrong API or library in one location in your codebase?

    • @unprogramadormas22
      @unprogramadormas22 12 วันที่ผ่านมา

      Definitely no, remember that always we use a pattern we are bringing complexity to the program. If u only need to access one tiny part of a codebase, why would be adding a whole class as an adapter a plausible solution?

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

    Whats your color theme called?

  • @kamilzielinski504
    @kamilzielinski504 26 วันที่ผ่านมา +1

    another chapter of OO devs solving issues they created

  • @TheForge47
    @TheForge47 27 วันที่ผ่านมา +1

    Nope, you don’t need any of those design patterns. It’s perfectly sufficient to focus on maximizing cohesion and minimizing coupling. In my opinion, the rest is more about convenience - nice to have, but not strictly necessary.

  • @gauravfotedar
    @gauravfotedar 10 วันที่ผ่านมา

    For the factory pattern example, why can't that just be a function?

  • @humphreeyy
    @humphreeyy 16 วันที่ผ่านมา

    So, singleton pattern is what I was using.

  • @vasiavra
    @vasiavra 28 วันที่ผ่านมา

    hi
    what keyboard is that ?

  • @howiplaygames....6424
    @howiplaygames....6424 2 วันที่ผ่านมา

    I was always using it but didn't know about it 😂😅

  • @oussamahatim5918
    @oussamahatim5918 21 วันที่ผ่านมา

    Singleton pattern is considered to be an anti pattern

  • @Gigusx
    @Gigusx หลายเดือนก่อน +1

    4:35 nice colors!

    • @xenos112
      @xenos112 10 วันที่ผ่านมา

      It's Andromeda theme I guess

    • @Gigusx
      @Gigusx 8 วันที่ผ่านมา

      @@xenos112 It is, and thanks for the name. I've installed it and like it a lot :D

  • @Jaybearno
    @Jaybearno 28 วันที่ผ่านมา

    Does anyone have recommended reading or examples on what to do if you inherit a horrendous code base that has every anti pattern imaginable? Would you try to encapsulate in a better design and unravel it? Or just nuke and start over.(keep in mind the latter will cost social capital). Help!!

  • @2spiffyytv
    @2spiffyytv หลายเดือนก่อน

    hey does anyone know what kind of keyboard he has?

  • @tibrec8
    @tibrec8 5 วันที่ผ่านมา

    I think u use Decoreter pattern but not the adpater pattern

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

    Where's the decorator?

  • @Sam-u3s7n
    @Sam-u3s7n หลายเดือนก่อน

    :D I am trying to study here --- why is the surf video ?? lol