Make Your Code Clean With the SOLID Principles

  Переглядів 93,180

Philipp Lackner

Philipp Lackner

2 роки тому

Writing clean code gets more and more essential the bigger your projects get. The SOLID principles help you do that.
⭐ Get certificates for your future job
⭐ Save countless hours of time
⭐ 100% money back guarantee for 30 days
⭐ Become a professional Android developer now:
pl-coding.com/premium-courses/
💻 Let me personally review your code and provide individual feedback, so it won't backfire and cost you a fortune in future:
elopage.com/s/philipplackner/...
Regular programming advice on my Instagram page: / _philipplackner_
Checkout my GitHub: github.com/philipplackner
You like my free content? Here you can buy me a coffee:
www.buymeacoffee.com/philippl...

КОМЕНТАРІ: 234
@Slake004
@Slake004 2 роки тому
Play the video in 2x speed then you'll be learning SOLID in 10 minutes
@feepin2058
@feepin2058 2 роки тому
But you will understand 2x less as well
@nishantaanjaneyjalan8583
@nishantaanjaneyjalan8583 2 роки тому
@@feepin2058 not necessarily
@MateusMeurer
@MateusMeurer 2 роки тому
Lmao
@nicolasmanurung
@nicolasmanurung 2 роки тому
So scary 😂
@rahulmatte6621
@rahulmatte6621 2 роки тому
Writing code is simple but writing simple code is difficult. Good work Philip, it helped me to learn SOLID principles 😅
@iamkrishn
@iamkrishn 2 роки тому
0:00 Introduction 0:51 Find problem with existing code 1:36 S = Single Responsibility Principle 4:05 O = Open Extensions, Closed Modifications 7:09 L = Liskov Substitution 9:43 I = Interface Segregation 11:31 D = Dependency Inversion Great explanation with a simple to understand example. Amazing videos as always.
@raplyanugrah4412
@raplyanugrah4412 2 роки тому
Vn
@raplyanugrah4412
@raplyanugrah4412 2 роки тому
Vvvvvvvvv
@raplyanugrah4412
@raplyanugrah4412 2 роки тому
Hv
@raplyanugrah4412
@raplyanugrah4412 2 роки тому
Gvv
@raplyanugrah4412
@raplyanugrah4412 2 роки тому
Ggvvv
@Alchemist10241
@Alchemist10241 2 роки тому
For Interface segregation principle; I think we shouldn't create a function (that sometimes needed and sometimes not) - printLogs() function in this video - inside the same interface, We should create another interface and declare this function in it and if we need this functionality we can implement this interface and plus other interfaces like FileLogger interface in this video
@joanmedia
@joanmedia 2 роки тому
Agree! But the video still is amazing.
@aliahmadabadiha3263
@aliahmadabadiha3263 Рік тому
You're right
@TheMohit987
@TheMohit987 Рік тому
That's what I thought. Apart from that, video was good.
@ltadeu61
@ltadeu61 Рік тому
Yeah! I did note that and agree with your response!
@diegohkdfln
@diegohkdfln 15 днів тому
Also agree. If I have an instance of FileLogger and call printLogs(), I'd expect it to print the logs, but it won't. Moving the printLogs() to a separate interface such as LogPrinter, would make more sense.
@aimenham4685
@aimenham4685 2 роки тому
finally , now i understand why interfaces are so important ,I struggled so much to find reason to use them , Thank you philipp
@adipurnomo5683
@adipurnomo5683 2 роки тому
Same here
@oliveryt7168
@oliveryt7168 Рік тому
Me too... I knew what an interface is in general, but not what it really means in coding (at least I had a bright moment)...
@vonn9737
@vonn9737 Рік тому
In example for open/closed, you treated the FileLogger class as being completely closed. Your CustomFileLogger was effectively another implementation of a FileLogger interface. It is ok to add new functionality to the FileLogger class, for example adding another function called timestampedError(), as long as you do not change the logError() function it adheres to the open/closed principle. All existing consumers of FileLogger will work exactly as they did before. For your example of Liskov substitution, the CustomErrorLogger class does not violate Liskov substitution. All instances of FileLogger can be replaced with CustomErrorLogger and will work exactly the same. This is because all calls to logError() will still go to the base FileLogger via inheritance.
@avigneswaranwaran
@avigneswaranwaran Рік тому
Your explanation is great. But, I have a question here, we already have a function named logError() in class FileLogger. So if we add timestampedError() to FileLogger it is not violating single resposibility principle? Kindly help me understand better
@stevebroshar3143
@stevebroshar3143 10 місяців тому
@@avigneswaranwaran well ... first of all timestampedError is not a good function name IMO. I follow the pattern of naming a function with a verb prefix. That, plus vonn didn't say what that function does makes it hard to know what vonn intends that function to do. But ... if that function is about logging to a file (logs a timestamped error?) then it does adhere to single responsibility (SR). Then again, vonn's comment is about Open/Closed (O/C) ... why are you asking about SR?
@alwaysbrillant10
@alwaysbrillant10 Рік тому
Been binge watching all your recent videos. Amazing Android content 👏🏽 👌🏽
@also_david
@also_david 2 роки тому
awesome man. I didn' like you previously when seen on interviews but Now addicted to how you teach and how humble you really are.
@sakhti007
@sakhti007 2 роки тому
Thankyou Philipp, your way of explaining the issues through examples is just amazing. Thankyou for this great video.
@mare10rooney
@mare10rooney 2 роки тому
Great video Philipp, would be awesome if you would cover more of these advanced topics. Keep up the good work!
@tgamings1
@tgamings1 6 днів тому
Vielen vielen Dank lieber Philipp für diese tolle Erklärung. Du hast da wirklich ein Talent solche Dinge sehr einfach für jeden verständlich zu machen. Liebe Grüße aus Österreich.
@niranz7745
@niranz7745 2 роки тому
This is literally one of the best channels out there. I can’t believe that I only found it now. I love the videos. Keep them coming! P.s- would love to see a video about Alarm manager in Kotlin! Looking for such a video for a while.
@devgabriel6898
@devgabriel6898 2 роки тому
Experience is so freaking important!. 6 months ago, i saw this video i didnt understand anything of it. Now i understand everything! Because without knowing, i used all of this on my job, day to day on Android. Excelent! Now going for theory behind design patterns
@cesarlabastida1392
@cesarlabastida1392 6 місяців тому
You have such a nice way of explaining things brother. Keep making these videos please. Thank you.
@khanzadakashif8248
@khanzadakashif8248 2 роки тому
Just the thing I needed. Surely will start using all these principles in my future projects.... Thanks bro...
@masti437
@masti437 Рік тому
I watched this video after watching your multi module course. So clearly explained .. I clearly understand why you inject abstractions using hilt instead of concrete implementation ..... Thank you so much Philip
@mahdizareei4575
@mahdizareei4575 2 роки тому
Thank you so much dear philipp for record this courses , I just wanted say i love you ❤️😘
@alvaroisea2259
@alvaroisea2259 2 роки тому
Thanks for this video man!, Big fan of your channel
@snehilsinha4689
@snehilsinha4689 Рік тому
Simplest and best example with clean examples just like your clean codes @Philipp ! Awesome :)
@devetips
@devetips Рік тому
really the most informative explanation of SOLID principles. appreciated and thanks a lot man:)
@ani-eg8dy
@ani-eg8dy 2 роки тому
This is simple AF , nobody showed this important principle with this level of simple and easy examples ! Take a bow @Philipp
@Abhishek_Sawant
@Abhishek_Sawant 2 роки тому
Keep making such videos.👍 It truly helps a lot.😌 Thank you 🙏🙂
@minasalah8210
@minasalah8210 Рік тому
thanks' a lot Philipp, appreciated your efforts
@haliltoprak585
@haliltoprak585 2 роки тому
Thank you so much for clear explanation of SOLID 🙏
@nishantaanjaneyjalan8583
@nishantaanjaneyjalan8583 2 роки тому
I got goosebumps when he said, "This changes the entire implementation in one line of code. 🦋"
@PhilippLackner
@PhilippLackner 2 роки тому
This is programmer porn
@farazahmed7
@farazahmed7 Рік тому
What a nerd 💀
@mustaqode_6617
@mustaqode_6617 2 роки тому
This is a most important video in the internet for devs today. It's not easy to explain this topic the way he did. Kudos @Philipp
@burakkarabekir459
@burakkarabekir459 2 роки тому
Great content. You made it clear for me. Thank you so much. . . . Thank you so much.
@razidwa852
@razidwa852 Рік тому
The best explanation I have ever seen. Great job
@lekshmiskrishnan5652
@lekshmiskrishnan5652 Рік тому
Thanks a lot for that awesome explanation!
@pratikpattanaik
@pratikpattanaik 2 роки тому
I think a more appropriate example of Liskov substitution principle would be if an overriden function were to do something unexpected and contrary to its implementation in the base class. This can be shown with a base function that changes the state of the class which is overriden by a function that doesn't call the super method. The example provided doesn't break this principle. I liked the other explanations.
@amavrik
@amavrik 2 роки тому
Great explanation man! Thank you!
@aginamabednego
@aginamabednego 9 місяців тому
Kudos Philip. This explanation was easy to grasp
@theophilus494
@theophilus494 2 роки тому
Philip God bless you soooooooo much.... i can't thank you enough
@kobeissi721
@kobeissi721 2 роки тому
For the optional interface function, you could also do = Unit instead of the empty function braces.
@PhilippLackner
@PhilippLackner 2 роки тому
Yea sure was just a quick demo here
@BilalBerek-tl3tq
@BilalBerek-tl3tq 2 місяці тому
@@PhilippLackner I think you must do make separate interfaces for every method. So you can use multiple inheritance for every method you need. Because function with empty body standing in the interface not a good case that much.
@daniyar2718
@daniyar2718 2 роки тому
I like how you explain complex things so easy👍nice
@basitaliwrites4828
@basitaliwrites4828 Рік тому
Thank you for the explanation I learned something new today
@Chintanparmar
@Chintanparmar 2 роки тому
The video we didn't ask for, but really needed..
@vitorferreira5464
@vitorferreira5464 Місяць тому
Best video about SOLID I've ever seen
@kareemjeiroudi1964
@kareemjeiroudi1964 2 роки тому
Well done video. Just pay attention to interface segregation. Interface segregation does not mean that clients do not need to implement the entire interface. It means that you should segregate different functions under several interfaces, and then it's up to the client to decide which interfaces to implement. I don't think the example here was demonstrative of interface segregation.
@PhilippLackner
@PhilippLackner 2 роки тому
agreed, thanks for the feedback!
@punerealestatebuilder
@punerealestatebuilder 2 роки тому
Probably onClickListener and OnLongClickListener are examples of it. Those 2 could be in a single interface, but that way you would have forced the class to implement these 2 methods even you want to use either of them.
@susanlama
@susanlama 2 роки тому
This videos was so helpful. Thank you
@wilsonahanmisi1187
@wilsonahanmisi1187 2 роки тому
This guy is really good.... Keep it up bro
@Coldalecs
@Coldalecs 2 роки тому
I finally understand them now, I faced the same problem when searching them online...very hard to understand. This was waaay easier to understand. Thank you!
@PhilippLackner
@PhilippLackner 2 роки тому
Glad it helped!
@Andrei1889
@Andrei1889 4 місяці тому
I would've killed for this video when I first started learning Android and programming; Thank you.
@jhngolan
@jhngolan 2 роки тому
So realy clearest explanation ever and simple practical Thank you Philipp
@PhilippLackner
@PhilippLackner 2 роки тому
Thanks mate!
@bjugdbjk
@bjugdbjk 2 роки тому
This is by far the best SOLID video explaining these complex SOLID software principles !! Thank you for this amazing content !!
@abood7meed509
@abood7meed509 Рік тому
Thank you it was very simple and easy to understand
@mandroidx1474
@mandroidx1474 2 роки тому
This is really helpful,some tutorial only targets output without considering clean code,thanks Philipp
@PhilippLackner
@PhilippLackner 2 роки тому
Glad you liked it
@NishantKumar-cr6fb
@NishantKumar-cr6fb 2 роки тому
Nicely and simply explained
@TripDude
@TripDude Рік тому
Thanks for the explanations with easy examples 👌👏
@techmarinar
@techmarinar 2 роки тому
thank you very much , this is really awesome
@vitalijuskolinko9011
@vitalijuskolinko9011 2 роки тому
Do we need to remove dependency on concretion of FileLogger class? For "I" principle you can split your interface in several interfaces. Thanks for video! ❤
@Another0neTime
@Another0neTime 2 роки тому
This guy does it again!!! Nice explanations.
@PhilippLackner
@PhilippLackner 2 роки тому
Glad you like them!
@puszkinowski
@puszkinowski 2 роки тому
great material, very helpful, thanks !
@funnymoment9164
@funnymoment9164 2 роки тому
Thanks. Very good explanation.
@abuiman5251
@abuiman5251 2 роки тому
Thanks bro!
@r_yan3531
@r_yan3531 2 роки тому
Hey Phillipp we need more videos on clean architecture, if possible please make a playlist on it. I will buy that playlist if it is paid but please make that playlist
@joemoe5954
@joemoe5954 2 роки тому
Please make more videos like this !
@RubabAzim
@RubabAzim Рік тому
Nice explanation on very complex and ambiguous topic. 👍👍 Plus i think we can do diff approach for interface segregation instead of giving default implementation.
@mrpi230
@mrpi230 2 роки тому
Thank You bro
@alperencevlik3104
@alperencevlik3104 Рік тому
Thanks Philipp
@binishmathew2671
@binishmathew2671 2 роки тому
Thanks philipp
@rezarizky8470
@rezarizky8470 2 роки тому
Sir, u are the best!
@TheCreator1197
@TheCreator1197 2 роки тому
For the open-closed principle, would you then be violating it if you provided a default parameter with the file path name, so that one could change the output location without extending the original class? Not sure if that's what you mean by closed to modification
@bonifaceyombwe9793
@bonifaceyombwe9793 2 роки тому
I always enjoy your videos. Would u do one video on adding time and date in an android studio app
@PhilippLackner
@PhilippLackner 2 роки тому
Thanks I do that in a bunch of my Playlists
@sakibsyed7626
@sakibsyed7626 Рік тому
Thanks buddy
@akashkumardas9670
@akashkumardas9670 2 роки тому
need to watch some more time. Thanks a lot
@opshankaprabath7913
@opshankaprabath7913 2 роки тому
This is a good tutorial to me thank you.
@balajijangde8470
@balajijangde8470 Рік тому
Great explanation
@Sc2MooDy
@Sc2MooDy 2 роки тому
thank you !
@abdallahelsyd
@abdallahelsyd 2 роки тому
thanks for this topic Really thanks :)
@karimelbahi1725
@karimelbahi1725 2 роки тому
Awesome continue plz.
@soroushlotfi6970
@soroushlotfi6970 2 роки тому
Brilliant content
@gyorgygab
@gyorgygab 2 роки тому
Very good video. One question regarding the Open Closed Principle: If I would create method for changing the path e.g.: open fun getPath(){...} Does this violate the principle?
@rogercolque
@rogercolque 2 роки тому
saw videos about this topic and this helps me to understood it better. easy to undertand also for stating with solid and why use it half of the video after that i lost
@firozshaikh121
@firozshaikh121 Рік тому
awesome man👍
@behnawm
@behnawm 2 роки тому
Perfection!
@PhilippLackner
@PhilippLackner 2 роки тому
Thank you!
@sergeisalnikov6427
@sergeisalnikov6427 2 роки тому
Hi!) I am from Russia and I am learning English to find a job in another country. You have good English I understand almost everything and your videos help me to learn the language))
@shreyashachoudhary480
@shreyashachoudhary480 Рік тому
Amazing!
@mattgraves3709
@mattgraves3709 2 роки тому
After watching this last night I went back and re-watched Bob's playlist on clean code... outstanding! Then today in a long term project interview (We interview internally for projects) I was asked, 'what are the SOLID principles of good software engineering?' I played it cool, .. 'fools, little do you know Phillipp just schooled me on this shit' ... barely had the words come out of my mouth when the hiring manager said "wait you know Phillipp?" ;) Joking aside, the synchronicity is insane man, thanks so much for everything!
@PhilippLackner
@PhilippLackner 2 роки тому
Haha thanks Matt! :D
@SudhanshuKumar-xy6xv
@SudhanshuKumar-xy6xv 2 роки тому
One of the best
@mohannadyoussef8683
@mohannadyoussef8683 Рік тому
Perfection
@awais2980
@awais2980 2 роки тому
Can you please make video on Important design patterns for Android developers? Thanks in advance.
@Jason-fg9wn
@Jason-fg9wn Рік тому
Thank you.
@hassanjamil841
@hassanjamil841 11 місяців тому
Superb!!
@sahilshokeen6078
@sahilshokeen6078 2 роки тому
Really amazing video
@MuhammadIbrahim-cc4kb
@MuhammadIbrahim-cc4kb 2 роки тому
Amazing content
@keepgoingman5829
@keepgoingman5829 2 роки тому
I love this!!!
@mattgraves3709
@mattgraves3709 2 роки тому
Awesome video!!
@oleg12395
@oleg12395 Рік тому
You are the best 👌
@shantanubopardikar7719
@shantanubopardikar7719 Рік тому
Bro, you are my new superhero, much much better than any other fictional superhero
@enomamichael5762
@enomamichael5762 Рік тому
lovve this
@VenewebTV
@VenewebTV 2 роки тому
Amazing video, I have studied the SOLID principles and I have never understood them so easily, congratulations, greetings from Caracas, Venezuela
@tinykingcontractor1396
@tinykingcontractor1396 2 роки тому
The thing that I liked about the video was not wasting my time to learn this SOLID buillshit. Thanks for summarizing.
@umairkhalid123
@umairkhalid123 2 роки тому
You got some perfect communication skills
@PhilippLackner
@PhilippLackner 2 роки тому
Thanks ❤️
@satyasaineelapala570
@satyasaineelapala570 2 роки тому
@@PhilippLackner Great video. I do have one doubt regarding auth in Dependency inversion. If we call auth.signInWithEmailAndPassword(), then which would be called among the functions in FirebaseAuthention and CustomApiAuthentication classes?Thanks in advance
@mrwhoknows
@mrwhoknows 2 роки тому
@@satyasaineelapala570 you have to pass authenticator object while creating instance of Repository, if you've passed firebaseAuthenticator then it'll use that, and vice versa
@satyasaineelapala570
@satyasaineelapala570 2 роки тому
@@mrwhoknows Thanks
@vinaykumarpatel649
@vinaykumarpatel649 2 роки тому
Thanks boss
@anudeepananth
@anudeepananth 2 роки тому
Hi Philipp.... Could you please do a video on How to use Ktor on an Android client...
@polotika1962
@polotika1962 2 роки тому
Can you please make medium scale app with clean architecture so we can practice on it.
@armandoavila4615
@armandoavila4615 2 роки тому
Thank you!
@PhilippLackner
@PhilippLackner 2 роки тому
You're welcome!
@phamhung2263
@phamhung2263 2 роки тому
thanks, it looks very easy to understand. Do you have any video about customizing views in android?
@PhilippLackner
@PhilippLackner 2 роки тому
Only in compose
@pstlvictoras
@pstlvictoras 2 роки тому
do you have an example of project with clean arhitecture?
@Punarjagran
@Punarjagran Рік тому
grateful :)
Sealed Classes VS. Enum Classes VS. Sealed Interfaces - When to Use Which?
10:15
Learn SOLID Principles with CLEAN CODE Examples
28:35
Amigoscode
Переглядів 254 тис.
Первая поломка Scirocco! Балацко попал на мотор.
1:13:12
Эффект Карбонаро и устройство для распаковки
01:00
История одного вокалиста
Переглядів 1,7 млн
SOLID Principles: Do You Really Understand Them?
7:04
Alex Hyett
Переглядів 104 тис.
How to Make Your Code Clean With Kotlin Sealed Classes
18:09
Philipp Lackner
Переглядів 40 тис.
How principled coders outperform the competition
11:11
Coderized
Переглядів 1,5 млн
What is the Context? - Android Basics 2023
11:22
Philipp Lackner
Переглядів 45 тис.
How You SHOULDN'T Apply to Companies
0:40
Philipp Lackner
Переглядів 12 тис.
React Clean Code: Advanced Examples of SOLID Principles
28:03
CoderOne
Переглядів 20 тис.
This is the Only Right Way to Write React clean-code - SOLID
18:23
CoderOne
Переглядів 612 тис.
Первая поломка Scirocco! Балацко попал на мотор.
1:13:12