Learn SOLID Principles with CLEAN CODE Examples

  Рет қаралды 272,768

Amigoscode

Amigoscode

Күн бұрын

Пікірлер: 340
@amigoscode
@amigoscode 2 жыл бұрын
► Get NordVPN exclusive deal here: nordvpn.com/amigoscode Try it risk-free thanks to their money-back guarantee! ► Grab your copy Clean Code copy here: amigoscode.hypg.es/amzn/clean-code ► Git Repo with examples: amigoscode.hypg.es/github/amigoscode/solid
@adhambaquroun898
@adhambaquroun898 2 жыл бұрын
unfortunatly the link to the book is not working (Error 404)
@faridunberdiev8598
@faridunberdiev8598 2 жыл бұрын
Assalamu aleykum, brother! Ramadan Mubarak 😁
@soto5987
@soto5987 2 жыл бұрын
I use these shortcuts quite often, maybe it is useful for you too :) For mac Delete line at caret ⌘⌨ Extend selection ⌥↑
@its_me_mahmud
@its_me_mahmud 2 жыл бұрын
Github repo link is not working
@abdulazizzarifboyev6082
@abdulazizzarifboyev6082 2 жыл бұрын
Design Patterns would be great
@francksgenlecroyant
@francksgenlecroyant 2 жыл бұрын
I really missed Amigoscode, I can't believe he still can take his time to share these incredible resources and knowledge during this fasting period, thanks Nelson 🙏🙏🙏
@uncomputable929
@uncomputable929 2 жыл бұрын
not like you are unable to do anything while fasting
@mateuszorlicki5907
@mateuszorlicki5907 2 жыл бұрын
@@uncomputable929 how long does the post last ?
@coffeedude
@coffeedude 2 жыл бұрын
@@uncomputable929 I actually found out that fasting makes me do more stuff, not less
@Naimadmdp
@Naimadmdp 2 жыл бұрын
Exactly the video that I was looking for! Excelent as always!!!
@punithgowda8890
@punithgowda8890 2 жыл бұрын
Hi amigo can please make videos on java Design structures.
@goldbow9805
@goldbow9805 8 ай бұрын
That was a SOLID video. Thanks a lot.
@MyRealityIsProof
@MyRealityIsProof 2 жыл бұрын
Even though I code in C#, I can still follow a lot of what you are teaching.
@omerisk8934
@omerisk8934 Жыл бұрын
AleykumSelam Mashallah brother the cleanest explanation that can be found ever! Finally everything is in place on SOLID principles. I appreciate and strongly recommend it.
@rafaah28
@rafaah28 2 жыл бұрын
Good video, I abstracted more about this S.O.L.I.D Principles content. Thanks, bro!
@КалоянБожилски-ь8с
@КалоянБожилски-ь8с Жыл бұрын
Very useful and easily understandable video. Good job!
@abdulmateensyed9056
@abdulmateensyed9056 2 жыл бұрын
Next video on design patterns much appreciated
@hacksontable5850
@hacksontable5850 11 ай бұрын
Great video. Thank you👍
@John_Smith_Java
@John_Smith_Java 2 жыл бұрын
It was really easy and fun! Thanks Nelson!
@eaqyyy
@eaqyyy 2 жыл бұрын
Nelson, I really like your code review videos, can you please do a code review in golang? Much love from Singapore
@crimsoncomet564
@crimsoncomet564 Жыл бұрын
Dependency inversion principle: Why can we not create the interface only when we need it? I think it is useless to have an interface if you know there will always only be one implementation.
@ThomasKlammer
@ThomasKlammer 10 ай бұрын
doesn’t moving the area calculation in the objects cube, circle, square, … violates the single responsibility principle?
@leonardolacerda1239
@leonardolacerda1239 2 жыл бұрын
So in the last principle you extracted the class into a interface to inject the interface and not the concrete class, that I understood. But using spring generally I inject my services as concrete classes, is that wrong? Should I create a interface for all my services? Sorry if I spell something wrong, i'm developing my english yet lol
@MaryamMaqdisi
@MaryamMaqdisi 2 жыл бұрын
I think it'd depend on your company, I've seen some people doing it and others saying they never do it, but technically yes using interfaces would decouple things more
@blackberry-ke3fi
@blackberry-ke3fi 2 жыл бұрын
Please make a video for Design patterns, as it will be beneficial for all developers. Thanks for your effort in bringing useful content to the community. Highly appreciated!
@fuckwdf
@fuckwdf 2 жыл бұрын
Yes, we all need simple explanation about Abstract Factory and Factory Method
@user-rl5pb5un2f
@user-rl5pb5un2f 2 жыл бұрын
@@fuckwdf Helpline📲📥⬆️ Questions can come in⬆️
@user-rl5pb5un2f
@user-rl5pb5un2f 2 жыл бұрын
Helpline📲📥⬆️ Questions can come in⬆️..
@fiorini_mochachino
@fiorini_mochachino Жыл бұрын
@@fuckwdf Have you seen this: kzbin.info/www/bejne/kHfaf4GphbxmY7M ? Found it really clear.
@coderider3022
@coderider3022 2 жыл бұрын
SOLID is a must know skill in OO development but I think we should be willing to modernise it and make it fit in 2022 when industry is moving towards functional coding. I’m a 20 year c# vet and do full solid on most projects but it’s hard to justify the abstractions for smaller projects. You end up with too many single method classes which can be functions instead.
@ivanvelinov4630
@ivanvelinov4630 Жыл бұрын
Why does it matter if you have a single function or a single class with a single method? You're gonna have more files true, but still I dont see a problem here.
@spas_minkov
@spas_minkov Жыл бұрын
@@ivanvelinov4630 Overhead, both In computer and cognitive sence. Besides it is unnatural to put everything into its own box. Generally it is easier to spot a thing put into a bigger box, with many other things, rather than if everything, no matter how small was put into its own box, even if there is a label on each box. It's mentally draining, and the biggest nonsense of OOP to me, besides it is never used on big real life projects. The same with the modern notion of microservices. We are not far away from the time, when a new "breakthrough" in the programming would be ”discovered” in the form of a revolutionary notion for “macroservice“ (highly sarcastic here) as it is functional programming now. Something old, then forgotten in favor of the new hype, and then rediscovered as something “revolutionary" (sarcasm)
@2gbeh
@2gbeh Ай бұрын
And who says grouping "related" functions/methods into a single class (eg. Utility classes) breaks SOLID?
@story4uall
@story4uall 2 жыл бұрын
It would be nice if you can provide some videos on Design Patterns
@ansgarnell9316
@ansgarnell9316 Жыл бұрын
Great video! About the Liskov Substitution principle, although your explanation was right, the description should be exactly the opposite: every base or parent class should be substitutable by its derived or child classes. So, taking your example, if we have: Shape shape = new Shape(); shape.area(); in our code, we should be able to substitute the first line for: Shape shape = new NoShape(); but this would throw an exception, so we don't fullfil this principle. On the other side, if we have: Animal animal = new Animal(); animal.eat(); We could substitute it for: Animal animal = new Dog(); and it would still work as dogs have to eat. Hope that makes it more clear.
@nathanyt
@nathanyt 11 ай бұрын
Also, please correct me if I'm wrong, he didn't have to create a new class to demonstrate LSP. The fact that he has a function that accepts "Shape" and it works even when it's supplied with objects of different shapes (Square, Circle, etc), that in itself obeys LSP because all of those are derived from "Shape".
@alimrad7760
@alimrad7760 2 жыл бұрын
yeah , please make a videos about Design pattern...
@joshuagarza3747
@joshuagarza3747 2 жыл бұрын
Would love to see a video on Design Patterns!
@dulajmadumal3116
@dulajmadumal3116 2 жыл бұрын
In an OPC example, we implements the Shape interface and @Override method in the Square class. in this time we break the SRP it's that true????? because we ad a new method Our Square class.
@shivanshugautam1381
@shivanshugautam1381 2 жыл бұрын
Sir please make a video on OOPS concept in java with real time example
@kaliljanan
@kaliljanan 2 жыл бұрын
It took me some time to understand Single responsibility. Each class can and should have more than one method, how do you do for them to have only one responsibility. The answer lies in "reason to change" as far as I know. Soo you should ask yourself what would make your code to change, like csv to json or saving in a file or a database or a queue.
@Mohamed_Majed
@Mohamed_Majed Жыл бұрын
Thanks bro, that was amazing, good explanation
@programuoki-lt1465
@programuoki-lt1465 Жыл бұрын
Liskov principle still is not clear enough. I watched different videos and only one explaining more deep with solution for it. When you need to create Base class to solve that issue. Because now I see that if its break rule you just remove from list and its done :) Similar to videos where suggesting remove object if breaks rule -> but if you still need it that object? P.S. sometimes classes is concrete parent classes not Abstract or Interfaces.
@blighthornsteelmace820
@blighthornsteelmace820 Жыл бұрын
in short: Derived classes should not violate the expectations the users of the parent class have of it. Sometimes the solution is to not extend things that looks like they should be exteded.
@shahabbadihi3453
@shahabbadihi3453 2 ай бұрын
Much clear, but I have a question that why didn't you make the ThreeDimensionalShape interface inherited from the Shape interface? Is the interface inheritance an unusual practice, or there was another reason?
@abrorallaberganov6293
@abrorallaberganov6293 Ай бұрын
I thought just like you. However, in my view, he just wanted to make it as much as simple.
@gabrielgil2346
@gabrielgil2346 2 жыл бұрын
I have literally just skiped that class in my university, thank you very much for being just in time lol!
@Victor-gj7pi
@Victor-gj7pi 2 жыл бұрын
You are a blessing to java developers. We got your back
@cheikhouly128
@cheikhouly128 2 жыл бұрын
This is one of most important topic (and design patterns) that every developer should learn to write better code. I've met experienced developer who didn't know about these subjects and it's so unfortunate. Thanks a lot 💪🏾
@derekdevs
@derekdevs Жыл бұрын
This is probably the fourth or fifth SOLID video I’ve seen since being introduced to the topic and, while they have all been informative, yours sunk in. Thank you so much for this. New Sub!
@codiphobia884
@codiphobia884 2 жыл бұрын
Masha Allah. As a non-english person, I can clearly get the information. what an amazing explanation 😍
@ИванИванов-ч6я1ы
@ИванИванов-ч6я1ы 2 жыл бұрын
Hello, sir! I want to thank you very much, for the tutorials and the work you are doing, and the effort you put in these youtube videos. Thanks to your tutorials, here in this youtube channel, I managed to land a job as a Java developer. Never give up guys! Hard work pays off!
@okorougochukwusamuel9962
@okorougochukwusamuel9962 2 жыл бұрын
Congrats 🍾🎉
@artemlisitsyn9846
@artemlisitsyn9846 2 жыл бұрын
Congrats man! Absolutely agree with u!
@Oblivianos
@Oblivianos 2 жыл бұрын
I've been working as a software engineer for 2.5 years and do my best to obey the SOLID, this is by far the best explanation video of all the principles. Usually the interface segregation and liskov were not explained or ignored in case of languages like Ruby ( my first job / 2 years). Kudos man
@peterbrown6762
@peterbrown6762 2 жыл бұрын
I love your videos, you are amazing! Can you sometime please make a tutorial with some real project, with all classes and private parameters as it should be (no compromises), just a real project. I believe this will be very interesting, I hope this is possible for you, because I know it is time consuming. Thank you for everything anyways! :)
@MaxAigner
@MaxAigner Жыл бұрын
Hi Amigoscode, thank you for the great video, however one thing to notice: I might be wrong, so feel free to correct me: The single responsibility is not about having a single purpose, but rather about having a single customerbase "single actor/purpose" whom the class/functionset is being programmed for. The functions should not be shared amongst different stakeholders like the finance team and the HR team in a company that both need a way to calculate the salary of a person - they should have different codebases for that because they are different actors. The principle of having a function do only one thing is not part of the Solid Principles of Uncle Bob, even if it is a very wise thing to do. (Read more in "clean architecture" by uncle bob.)
@youtubeenjoyer1743
@youtubeenjoyer1743 Жыл бұрын
Please don't follow this advice, it leads to unreadable, hard to debug, and slow software.
@hasithapriyasad
@hasithapriyasad 5 ай бұрын
Can you explain?
@erbugakbal
@erbugakbal 2 жыл бұрын
Amazing explanation as always. Can't be explained faster than this. Much appreciated!
@Mr.Mouihbi
@Mr.Mouihbi 2 жыл бұрын
More similar content 🚀🚀
@Chroncher
@Chroncher 11 ай бұрын
Iam wondering if there is a specific reason why you are using the Object class instead of Generics? For example in: public int sum(List shapes) {...} -> why not do this instead: public class Areacalculator { public int sum(List shapes){...} then you wouldnt have to bother about typesafty afterwards. but iam relatively new to OOP so please enlighten me if iam mistaken.
@mahatana_r
@mahatana_r Жыл бұрын
I feel bad with my adblock when the content is excellent like this. I disabled it and rewatched it gain.
@BenZekriNBENZ
@BenZekriNBENZ 8 ай бұрын
The last is just waaw and it's used in the most framework especially in Spring framework, thank you so much, this will help me a lot to become a better developer 😎
@mohamedbidoudan5854
@mohamedbidoudan5854 Жыл бұрын
I have a question please, For Liskov Segregation can we extend the main Interface So instead of implementing multiple interfaces we implement fewer ones, for example ThreeDimentinalShape extends Shape, so the Cube for example will implement just ThreeDimensionalShape, and Circle will implement just Shape, is it a good practice or it will break another good principle...
@ahmedbishree9429
@ahmedbishree9429 2 жыл бұрын
Thanks dear brother may ALLAH accept your duaa, fasting, and prayers :) SOLID PRINCIPLES ►IP Single Responsibility Each class should have only one sole purpose, and not be filled with excessive functionality ►Open Closed Classes should be open for extension and closed for modification. In other words, you should not have to rewrite an existing class for implementing new features. ►Liskov Substitution This means that every subclass or derived class should be substitutable for their base or parent class ►Interface Segregation Interfaces should not force classes to implement what they can't do. Large interfaces should be divided into small ones. ►Dependency Inversion Components should depend on abstractions, not on concretions.
@raveviner
@raveviner 2 ай бұрын
you should have extended the ThreeDimansionalShape with Shape. and maybe even create TwoDimansionalShape class.
@KolomiecSergeyK
@KolomiecSergeyK 2 жыл бұрын
Thanks for the video! One small point, I think it will be great vs run app each time, create few tests and run this test to show in own example that you like tests and how it is easy to work with tests.
@jasperwhite8837
@jasperwhite8837 2 жыл бұрын
The SOLID principles are something I struggled with to abide by early one in my career and struggled walk explaining in interviews. This has definitely helped remember some examples and helped my understanding, cheeers! :D
@saidzbiri6247
@saidzbiri6247 Жыл бұрын
Thank you for such a clear and concise tutorial. You made a topic that seemed complicated easy to understand. I appreciate it!
@rasta_bounty
@rasta_bounty 2 жыл бұрын
The more I learn about Go the more Java looks like spaghettis 🤣 was my first love though. Thanks for making the SOLID principles concrete ! 🙂👌
@aqira2904
@aqira2904 2 жыл бұрын
Much appreciated for sharing Nelson, your explanation is very clear and easy to understand as always. I have one question tho, at 21:05 can we not just extend the Shape interface to ThreeDimensionalShape interface? Or does it violate the principle?
@KaraSuraDraw1
@KaraSuraDraw1 2 жыл бұрын
What do you mean by extending? Like ThreeDimensionalShape extends Shape?
@TischBacchus021
@TischBacchus021 2 жыл бұрын
@@KaraSuraDraw1 I think he means it as you mentioned
@Kikikan
@Kikikan 2 жыл бұрын
In this example it is possible to do so. As long as every method of Shape makes sense for 3D Shapes it does not violate the principle.
@AvgDan
@AvgDan Жыл бұрын
18:13 to 18:21 I don't think it's proper to be calling an interface a "parent" or "super class". I believe Shape should have been a regular or abstract class as you don't derive a child/subclass from an interface. The Shape class itself could have implemented an IShape interface if one were needed to be present to explain interfaces. Pretty good video nonetheless.
@jesper7605
@jesper7605 Жыл бұрын
I can see why you went with a textbook example using shapes, but I think it would have been better if you used a more realistic example that you might encounter in your career at a company. Alternatively include a section on if's and but's and things to consider when using the SOLID principles since it often not so straight forward in real life.
@sambalykote9889
@sambalykote9889 2 жыл бұрын
I have been looking for a tutorial on hexagonal architecture, if you can do a video with a complete demo on that it would be great.
@linjustek
@linjustek 2 жыл бұрын
Now I'm confused by LSP explanation. I thought that LSP is just a method arguments and return type declaration implemented by interface or by abstract class, that has to be followed by child class, otherwise you'd get compiler errors when using interface. When using abstract class you usually set a an exception that this or that method has to be implemented, when not implemented. But usually all modern languages handle LSP by default with exceptions when something is a miss. 🙂 But everything else seems great.
@hamed6899
@hamed6899 Жыл бұрын
Salam I have a question about last principle. The change that you made caused the sum of shape areas calculated twice. Does this reject clean coding or I am wrong ??
@ne0n2005
@ne0n2005 Жыл бұрын
I realy did not get Liskovsch by your example. Why should I ever create a shape which is no shape at all ?! Can any come up with a reallife example for the principle?
@caffeinejavacode1475
@caffeinejavacode1475 2 жыл бұрын
Is there diff bettwen return "{sum:\s" + sum(shapes) + "}"; and return "{sum: %s}".formatted(sum(shapes));
@Vyshnavi-e4m
@Vyshnavi-e4m 3 күн бұрын
Excellent examples and explanation But didn't understand the last rule much 😅
@rudinandrey
@rudinandrey 2 жыл бұрын
Ufffff, iof you want to understand what is Solid you don't see this vedeo. Sorry man, but in Internet a lot of shif like this :( I see, you don't understand what is Solid ( if to be honestly I told only about letter S.
@selahadinjemal7138
@selahadinjemal7138 Жыл бұрын
The thumbnail is misleading. I was searching for your vids and I thought this was someone else's video! you should put your picture on it.
@2gbeh
@2gbeh Ай бұрын
Oh no, please revisit your Liskov Substitution usecase wasn't quite right.
@francksgenlecroyant
@francksgenlecroyant 2 жыл бұрын
I really missed Amigoscode, I can't believe he still can take his time to share these incredible resources and knowledge during this fasting period, thanks Nelson 🙏🙏🙏
@samuelnjenga7912
@samuelnjenga7912 2 жыл бұрын
So wonderful, thanks a lot Jamal
@caffeinejavacode1475
@caffeinejavacode1475 2 жыл бұрын
It is very pibfull when application architectue has not been thoughtful Can you share with as GRASP or other Architecture best practices wich you familiar
@bodymurat
@bodymurat Жыл бұрын
I don’t get it. Moving the area calculation to the model objects itself, isn’t it destroying the Singe Responsibility again?
@John_Smith_Java
@John_Smith_Java 2 жыл бұрын
I've been going for a long time to buy a course on micro services. As soon as I was ready to do this, the cards of Russian banks turned into useless plastic. Sad😟
@heudon
@heudon Жыл бұрын
Hey man, you forgot to split the part from ISP and DIP, in the end of the video. Nice video, by the way.
@xEmran
@xEmran 2 жыл бұрын
Assalamualikum. Brother can you tell me the required configuration for Android development.
@trnrvl
@trnrvl 2 жыл бұрын
Nice work bro 👌🖐️🇺🇦
@bugrasessevmez
@bugrasessevmez 2 жыл бұрын
Sa brother, where is your linkedln url? I would like to follow on there. And I think you can reach many people over there…
@laislodi
@laislodi 7 ай бұрын
Fantastic explanation! BEST VIDEO about SOLID
@ollysalanson9452
@ollysalanson9452 2 жыл бұрын
I'm so glad I found your channel, you're a great teacher. Thanks so much!!
@melissapereira6957
@melissapereira6957 7 ай бұрын
but why is it called dependency inversion? like, where is happening the inversion ? why this name?
@edetmmekut809
@edetmmekut809 2 жыл бұрын
I think am first to watch
@akshitasaxena7805
@akshitasaxena7805 6 ай бұрын
Hey Please make complete detailed video on all types of design patterns. Thanks :)
@cumbi-mongo
@cumbi-mongo Жыл бұрын
Good content! Thanks. IMO the last chapter is supposed to be a two chapters, right?
2 жыл бұрын
Very interesting big hommie
@adisaisubrahmanyamvaskuri4048
@adisaisubrahmanyamvaskuri4048 9 ай бұрын
Thanks for your knowledge, good teaching. I really appreciate it
@TheOnlyEzzo
@TheOnlyEzzo 9 ай бұрын
Great video! Very clear SOLID Principles explanation
@saministor9054
@saministor9054 Жыл бұрын
Really helpful. My first video on this channel and I am surprised :)
@alexanderortiz2820
@alexanderortiz2820 2 жыл бұрын
Hi bro, i cant understand what you said but im suscribe why amigos === "friends" and im latin
@TheBordereagle
@TheBordereagle 6 ай бұрын
i was searching for this type of tutorial . u readd my mind bro.
@FranciscoQuintero-em7tr
@FranciscoQuintero-em7tr Жыл бұрын
Ci/CD with docker github springboot angular/react and database
@abraaobraz9408
@abraaobraz9408 2 жыл бұрын
Hi, could you please talk about clean architeture using spring boot.
@jamaludinalafghan6125
@jamaludinalafghan6125 2 ай бұрын
Jazakallah khair Amigos, great knowledge :)
@martinezjosei
@martinezjosei Жыл бұрын
Hi friend: Your big head is covering some of the code! LOL!!!
@rahimeyldz2272
@rahimeyldz2272 2 жыл бұрын
Thanks for nice videos, please next video Design Patterns!!!
@БогданДондук
@БогданДондук Жыл бұрын
Let's kick off this video without further ado... Nord VPN...
@chelkatrao
@chelkatrao 2 жыл бұрын
Design patterns
@oneminutecoder
@oneminutecoder 2 жыл бұрын
You say will teach everything we need to know ! You can't do this. These marketing languages annoy me.
@user-zx8pk4qm3k
@user-zx8pk4qm3k 2 жыл бұрын
Hey Amigoscode! What Java version are you using?
@bakre_dev8728
@bakre_dev8728 Жыл бұрын
Cool bro ...
@edetmmekut809
@edetmmekut809 2 жыл бұрын
It came just at the right time
@amineboubekri1577
@amineboubekri1577 2 жыл бұрын
Design Patterns pleaaase, will be so helpfull, thansk a lot for sharing
@tomasglavina4166
@tomasglavina4166 2 жыл бұрын
The link to the book is down. Is there another way to get it and still help you out?
@ciliyaciliya2294
@ciliyaciliya2294 2 жыл бұрын
Could u pls do a video on RxJava and Akka framework?...
@JhAyDeSiGnS
@JhAyDeSiGnS 2 жыл бұрын
Asalam amigoscode please can you do microservices with node js
@bobweiram6321
@bobweiram6321 2 жыл бұрын
Great lecture. On a minor point, a cube has a volume rather area.
@Thewatchervs
@Thewatchervs 2 жыл бұрын
Assalamu alaykum! Bro your link on clean code is not working
Learn Dependency Injection and Write Better Code
21:52
Amigoscode
Рет қаралды 173 М.
SOLID  Principal - Interview Questions and Answers
24:04
Interview Happy
Рет қаралды 111 М.
GIANT Gummy Worm Pt.6 #shorts
00:46
Mr DegrEE
Рет қаралды 96 МЛН
Миллионер | 1 - серия
34:31
Million Show
Рет қаралды 2 МЛН
Cute
00:16
Oyuncak Avı
Рет қаралды 12 МЛН
Uncle Bob’s SOLID Principles Made Easy 🍀 - In Python!
19:09
ArjanCodes
Рет қаралды 296 М.
Solid Programming - No Thanks
32:00
ThePrimeTime
Рет қаралды 303 М.
How Senior Programmers ACTUALLY Write Code
13:37
Thriving Technologist
Рет қаралды 1,5 МЛН
Liskov's Substitution Principle | SOLID Design Principles (ep 1 part 1)
16:08
Christopher Okhravi
Рет қаралды 159 М.
Being Competent With Coding Is More Fun
11:13
TheVimeagen
Рет қаралды 82 М.
the right way to organise your code
17:33
Amigoscode
Рет қаралды 198 М.
5 Signs of an Inexperienced Self-Taught Developer (and how to fix)
8:40
This is the Only Right Way to Write React clean-code - SOLID
18:23
10 Spring and Spring Boot Common Mistakes You Need To STOP
15:49
Amigoscode
Рет қаралды 151 М.
My 10 “Clean” Code Principles (Start These Now)
15:12
Conner Ardman
Рет қаралды 231 М.