7 Design Patterns EVERY Developer Should Know

  Рет қаралды 81,634

ForrestKnight

ForrestKnight

Күн бұрын

Пікірлер: 121
@noodlespwn42
@noodlespwn42 6 күн бұрын
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 6 күн бұрын
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 6 күн бұрын
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 ;)
@RafaeldaSilvaPeres
@RafaeldaSilvaPeres 5 күн бұрын
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!
@derivadadekonoha
@derivadadekonoha Күн бұрын
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....
@pouyababaie2159
@pouyababaie2159 6 күн бұрын
This was the most easy way to understand all of these standarts. Thanks ;)
@mykalimba
@mykalimba 2 күн бұрын
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.
@KineticCode
@KineticCode 6 күн бұрын
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 6 күн бұрын
Newer developers, you shouldn't be making the decision to not study software engineering concepts based off the anecdotes of anonymous KZbin 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 6 күн бұрын
Yeah its not a hammer. Its like 23 different tools actually. Hammer included
@KineticCode
@KineticCode 6 күн бұрын
​@@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 6 күн бұрын
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 5 күн бұрын
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.
@gavinwilliams4330
@gavinwilliams4330 5 күн бұрын
Great video! I love the way you explained things and the way you demonstrated the benefits of each pattern in code.
@shahabjami3161
@shahabjami3161 6 күн бұрын
Great refresher! Love these type of vids
@ianramirez1577
@ianramirez1577 6 күн бұрын
I learned more from your video than in the university. Thank you and regards from México
@Zeraltz
@Zeraltz 3 күн бұрын
Finally I understood these design patterns, you know how to explain things! subscribed
@HP_Tubcraft
@HP_Tubcraft 6 күн бұрын
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 5 күн бұрын
This was so good. I’m sharing it with my dev team! Thank you
@WiktorWandachowicz
@WiktorWandachowicz Күн бұрын
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 😁🤣😂
@codeman99-dev
@codeman99-dev 5 күн бұрын
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 4 күн бұрын
Correct, I don’t think he really understands what the observer pattern is.
@drushkyy2017
@drushkyy2017 5 күн бұрын
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
@Gigusx
@Gigusx 5 күн бұрын
4:35 nice colors!
@sebastianalfaro1887
@sebastianalfaro1887 6 күн бұрын
i was needing this this morning haha, thanks dude!
@ElHirani
@ElHirani Күн бұрын
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
@elki_8
@elki_8 6 күн бұрын
Thank you!! I got exams about exactly those patterns next week!
@totollygeek
@totollygeek 3 күн бұрын
Really cool video, kudos. I giggled when you called them “freedom units” 😂
@juancriolivares
@juancriolivares 4 күн бұрын
Great explanation. Beside these ones, I really like the decorator pattern.
@mcstephen
@mcstephen 12 сағат бұрын
A Video i never knew i needed. Thanks alot, for real, thanks.
@bradchellingworth5973
@bradchellingworth5973 Күн бұрын
first time viewer here, listening to this in the background and keep thinking im getting a lesson from Matthew McConaughey
@tiagodev5838
@tiagodev5838 3 күн бұрын
Great instructional video, thank you! Also, "Freedom Units" is one of the most American things I've ever heard haha!
@ashishsapkota945
@ashishsapkota945 6 күн бұрын
I came to find out that I have been using most of those patterns without knowing what they were
@diabeticnomad
@diabeticnomad 4 күн бұрын
6:00 oh shit! That just solved a problem I had sweet thanks
@Ni7ram
@Ni7ram 6 күн бұрын
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 5 күн бұрын
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 4 күн бұрын
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.
@parttimewarrior5789
@parttimewarrior5789 Күн бұрын
I don't know who this comment is for, but this feels like watching an Adam Ragusea video except about programming
@ImNotAshhhhhhh
@ImNotAshhhhhhh 2 күн бұрын
I feel like a lot of the issues that design patterns resolve can be fixed with simple static classes with static methods
@NebulaM57
@NebulaM57 Күн бұрын
Freedom Units, I like that. :)
@TAHppled
@TAHppled 5 күн бұрын
I clicked subscribe as soon as he said “freedom units”.
@cris7775
@cris7775 3 күн бұрын
Love It, great explanation
@BooksWeCanRead
@BooksWeCanRead 6 күн бұрын
100% want you to explain everything to me 😅💜
@pawel_890
@pawel_890 6 күн бұрын
When can we expect a video of Rust on NixOS on Neovim?
@circle4106
@circle4106 3 күн бұрын
Factory pattern is so much more flexible when you're able to overload the method.
@owenrossi-keen2594
@owenrossi-keen2594 3 күн бұрын
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 3 күн бұрын
@owenrossi-keen2594 exactly answers the question i had on implementing this overloading technique on TS, coming from Java 😂. Thanks for the insight.
@KimHenriksen.
@KimHenriksen. 2 күн бұрын
Great video! “I’m looking for an AI tool that can quickly translate KZbin 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!”
@rojinbijukchhe44
@rojinbijukchhe44 5 күн бұрын
Thank you man :)
@stereocodes
@stereocodes 6 күн бұрын
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.
@jasonford7439
@jasonford7439 5 күн бұрын
@ForrestKnight Kinda random but can you drop a link to your chair model? Does the seat tilt too or only the back?
@lutfiikbalmajid3128
@lutfiikbalmajid3128 3 күн бұрын
Hi, Your new subs here! i like your video, the way you explain, and some little jokes you put in this video haha
@scarymojo5809
@scarymojo5809 4 күн бұрын
Would you still use the adapter pattern if you only accessed the slightly wrong API or library in one location in your codebase?
@youcefmoulla1828
@youcefmoulla1828 6 күн бұрын
Amazing video, Thank you
@kamilzielinski504
@kamilzielinski504 8 сағат бұрын
another chapter of OO devs solving issues they created
@ShootFirstNS
@ShootFirstNS 6 күн бұрын
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.
@asagiai4965
@asagiai4965 5 күн бұрын
I see that's why youtube is sending me notifications from weeks ago.
@SonAyoD
@SonAyoD 3 күн бұрын
fantastic video
@Dr.Schnizzle
@Dr.Schnizzle 3 күн бұрын
Correct me if I’m wrong, but isn’t the strategy pattern the same as polymorphism?
@narcissekabongo2616
@narcissekabongo2616 3 күн бұрын
which vscode theme are you using brother?
@snowman1185-v
@snowman1185-v 6 күн бұрын
Very nice. Thanks. :)
@aidanthompson5053
@aidanthompson5053 5 күн бұрын
4:08
@wiktor99321
@wiktor99321 4 күн бұрын
Whats your color theme called?
@vasiavra
@vasiavra 2 күн бұрын
hi what keyboard is that ?
@floristrading8418
@floristrading8418 4 күн бұрын
actually really fucking good
@Sam-u3s7n
@Sam-u3s7n 6 күн бұрын
:D I am trying to study here --- why is the surf video ?? lol
@Jaybearno
@Jaybearno 2 күн бұрын
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!!
@codewithfelix3940
@codewithfelix3940 6 күн бұрын
Had never written type script before but it looks so much like java which hv written for so long.
@TheForge47
@TheForge47 2 күн бұрын
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.
@onzl9477
@onzl9477 Күн бұрын
Tbh, hammer does solve everything.
@kaktysocraft4386
@kaktysocraft4386 2 күн бұрын
Хорошо 👍
@Sam-dh7fr
@Sam-dh7fr 6 күн бұрын
facade pattern : "ehhmmm, that's a bit too much code, so make it a function ". Really? is this what "smart" programmers spend their times with? AI is definitely replacing us.
@2spiffyytv
@2spiffyytv 6 күн бұрын
hey does anyone know what kind of keyboard he has?
@notSoAnonyymus
@notSoAnonyymus 5 күн бұрын
Look not everything is nail but if you try hard enough everything is a hammer LOL
@ashersilver7388
@ashersilver7388 5 күн бұрын
Its all puzzle pieces. But they take so long to write!
@tawandagamedevs
@tawandagamedevs 5 күн бұрын
builder pattern is irrelavent if the language has named parameters
@thomaswilliams4755
@thomaswilliams4755 Күн бұрын
Not necessarily. `StringBuilder` is useful for when you need to build a long string, and iteration or conditional checks are involved. It'll save on the expensive costs of string concatenation (by maintaining and resizing an array for you behind the scenes, much like Java's `ArrayList` or C#'s `List` work).
@bertiesmith3021
@bertiesmith3021 13 сағат бұрын
@@thomaswilliams4755C++ programmer here I thought that the #1 point of StringBuilder is the efficient concatenation (which high I am led to believe can be really bad), rather than it being an implementation of a builder pattern. C++ has a similar problem but because strings aren’t immutable it is much less of a problem. It’s still worth worrying about, though, and Google’s StrCat solves this (and I have written my own versions many times).
@seventeeen29
@seventeeen29 6 күн бұрын
Mocking a singleton is a skill issue
@Hellbending
@Hellbending 3 күн бұрын
Is that… a js… class???
@IMustHaveThatApe
@IMustHaveThatApe 23 сағат бұрын
Forrest you need a wrist rest (that red sore at the base of your right hand)
@bertiesmith3021
@bertiesmith3021 13 сағат бұрын
Freedom units!
@deatho0ne587
@deatho0ne587 2 күн бұрын
You are hiding something on the Strategy Pattern. How does a user pick the car vs bike vs walk vs ... That still has to be done. User clicks dropdown and picks, then clicks a button cause most likely there is something else in there like does user eat at home vs McDs vs not eat at all vs ... To be fair I use all of the patterns depending on what is needed, but I do not think this is a whatever pattern it is just done.
@ChrisOfSDUB
@ChrisOfSDUB 5 күн бұрын
Where's the decorator?
@PiccoloBoruDaimao
@PiccoloBoruDaimao 6 күн бұрын
Where Is The Best Practice To Learn Java
@ep4r4
@ep4r4 3 күн бұрын
excelente en ESPÑAOL
@SogMosee
@SogMosee 5 күн бұрын
I will never use classes! Nevar!!
@muruganr4581
@muruganr4581 10 сағат бұрын
I really enjoy the sarcasm, programming was much simpler until Strict OOP and Typing languages became the mainstream. At the end of day most stuff a glorified mess.
@brayanyevenes5954
@brayanyevenes5954 6 күн бұрын
ForrestKnight, is it possible to include all the examples in a repository in your github, so I can have it in my favorites and I can check when to use which pattern according to the examples.
@Franky_PT
@Franky_PT 3 күн бұрын
Why am i hearing this in portuguese???? How do i turn it off
@AdamDymitruk
@AdamDymitruk 4 күн бұрын
Don't use any of them, maybe by accident. Not mentioning event sourcing is a crime.
@ramb0lxmb
@ramb0lxmb 4 күн бұрын
i passed it into the factory then i wrapped it in a adapter, b
@kevinurielfonseca
@kevinurielfonseca 4 күн бұрын
Basically this is an OOP approach, am I right?. The last time i wrote code like that was at 2019 lol. Nothing wrong with it but i dont think is necessary in JavaScript or web application unless your building something for an OS. C#, Java, C++ can all benefit from it, other than that....not really.
@Zonord
@Zonord 6 күн бұрын
как говориться забей болт
@nkangprecious4339
@nkangprecious4339 5 күн бұрын
TypeScript for design patterns? Skill issues
@anthonysalls
@anthonysalls 4 күн бұрын
Abstraction hurts decernability and debugging.
@berrycade
@berrycade 6 күн бұрын
Silly little OOP programmers always trying to fit nuanced ideas into neat little boxes. Focus on what your code does not what it “is” because that honestly doesn’t matter at all.
@aakkii5271
@aakkii5271 6 күн бұрын
Stupid remark, everything has a use, design patterns included, they are not rules, they are tools you decide to use when designing your software. What your software does is the easiest part of programming, making it functional is simple, making it performant, scalable, readable etc. is the real challange, and design patterns have tradeoffs in that regard
@berrycade
@berrycade 6 күн бұрын
@@aakkii5271 is my remark a member of stupid or is it serving a stupid purpose?
@TragicGFuel
@TragicGFuel 5 күн бұрын
@@berrycade all true what you said, except it's far easier to use design patterns as jargon to explain other people with the same knowledge. Compared to going through each step in the functional domain.
@berrycade
@berrycade 5 күн бұрын
@@TragicGFuel I’m not even really advocate for functional programming; in fact, i think most functional programs are convoluted just for the sake of being convoluted or in pursuit of “purity” at the cost of clarity and most other conventions that make code comprehendible. But at least FP wraps everything in logic - in Java I literally can’t have behavior unless cram it to some worthless object first. Classification can work with nouns sometimes but throw verbs into the mix and you’re begging for a clusterfũ.ćk. And the people who made these design patterns are just adding another layer of abstraction to add to the confusion. The world is not black and white, so we shouldn’t code that way either.
@diabeticnomad
@diabeticnomad 4 күн бұрын
Not really true if you the creator don’t focus on what it is future maintainers can’t focus on what it does 💜
@animelemon1
@animelemon1 6 күн бұрын
first!!
@binarystar-y9w
@binarystar-y9w 2 күн бұрын
Any advice on what tech job to pursue for long term safety?
@Hellbending
@Hellbending 3 күн бұрын
Mans out here on that “I might use Arch, btw + SplitErgoSoonTM + vim motions + Rust Gang” train and still putting out bangers? Lessgoo 💪🫡
8 Data Structures Every Programmer Should Know
17:09
ForrestKnight
Рет қаралды 199 М.
AI is not Designed for You
8:29
No Boilerplate
Рет қаралды 170 М.
Turn Off the Vacum And Sit Back and Laugh 🤣
00:34
SKITSFUL
Рет қаралды 11 МЛН
小路飞和小丑也太帅了#家庭#搞笑 #funny #小丑 #cosplay
00:13
家庭搞笑日记
Рет қаралды 17 МЛН
Dream⚽️
00:23
ISSEI / いっせい
Рет қаралды 3,9 МЛН
One day.. 🙌
00:33
Celine Dept
Рет қаралды 76 МЛН
5 Signs of an Inexperienced Self-Taught Developer (and how to fix)
8:40
This Video is AI Generated! SORA Review
16:41
Marques Brownlee
Рет қаралды 3 МЛН
10 Design Patterns Explained in 10 Minutes
11:04
Fireship
Рет қаралды 2,4 МЛН
The intro to Docker I wish I had when I started
18:27
typecraft
Рет қаралды 297 М.
Why Can't We Make Simple Software? - Peter van Hardenberg
41:34
Handmade Cities
Рет қаралды 132 М.
Docker Image BEST Practices - From 1.2GB to 10MB
7:15
Better Stack
Рет қаралды 70 М.
I Created The Best AI Tool Ever
9:12
ThePrimeTime
Рет қаралды 100 М.
Moore's Law is Dead - Welcome to Light Speed Computers
20:27
SwiftUI Architecture - Best Practices and Principles
39:04
AppForce1
Рет қаралды 1,7 М.
This Time is NOT Different.
8:01
Bravos Research
Рет қаралды 54 М.
Turn Off the Vacum And Sit Back and Laugh 🤣
00:34
SKITSFUL
Рет қаралды 11 МЛН