Liskov Substitution Principle Explained - SOLID Design Principles

preview_player
Показать описание
Writing clean code is tough, and is one of the largest differences between junior and senior developers. One way that you can quickly improve your code and start writing well designed code now is to implement the Liskov substitution principle. This principle is part of the SOLID design principles and is, in my opinion, the most important rule of SOLID for object oriented programming.

The main idea of the Liskov substitution principle is that any function/module that interacts with a class should also be able to interact with all subclasses of that class without breaking. This essentially means that a class is interchangeable with its subclasses.

Most likely you have written tons of code in violation of this principle, I know I have, but hopefully this video will help introduce you to why this principle is so good at making your code clean and maintainable.

🧠 Concepts Covered:

- What the Liskov substitution principle is
- Why the Liskov substitution principle is important
- How to use the Liskov substitution principle
- How to spot violations of the Liskov substitution principle

🌎 Find Me Here:

#SOLID #WDS #LiskovSubstituionPriniciple
Рекомендации по теме
Комментарии
Автор

Yes to composition vs inheritance video!

MrPogi-lfgz
Автор

Kyle, your approach to explaining these abstract, seemingly obscure principles and concepts with simple examples, is brilliant. So instead of approaching dry and abstract concepts from the top down with professorial lectures of principles that need to be understood, your bottom up approach with spot-on examples illuminate the subject matter. I have noticed how your subscriber base has been deservedly growing, and it is because of your clarity in presenting these topics and the relatively short videos that make it digestible. I wish you much continued success and look forward to your new videos. Best always.

majicboca
Автор

I didn’t realize you could be a great programmer, a fantastic teacher, AND a supermodel at the same time. Great video.

fernandobalino
Автор

Uauh. I've programmed since 2000s (vb6, turbo Pascal, etc) and I still enjoy each one of your videos! Good job!

rapha
Автор

You are such a great instructor ! Finally I understand all about SOLID in just couple of minutes.

muhammadumair
Автор

You are the dom perignon of online JS educators. Clear, concise and well structured! Thanks very much for your content 🙌🏻

SkriptKid
Автор

Okay... This is probably the first time i understood liskov. Thanks a lot man and yea i think you should make videos on composition and aggregation too...

Overall your content for solid is pretty solid 🎉👌

rishabhkalra
Автор

Thanks a bunch. Found your video while searching about "Why is it not allowed to narrow down scope of a method while overriding?" and also why the developers choose to do so.

It makes sense now. Thanks for making these topics so easy to understand.

maharun
Автор

I love these SOLID principles series, nicely done man!

reactdejv
Автор

I've read the whole clean code book by Uncle Bob and still didn't understand these SOLID principles as much as until your 10 minute video. Thanks!

jackhaugh
Автор

Finally a simple explanation of the solid principles....👍 for composition vs. Inheritance

bishopshawiii
Автор

Thank you for simplifying the Liskov principle for all of us with easy-to-comprehend examples. Keep up the good work!

phogbinh
Автор

The best content for SOLID on the Internet.

archiee
Автор

I had never understood the concepts of OOP in my school classes. Your explanations are very easy to understand!

puspamadak
Автор

This is an interview question I used to ask devs.. Btw, between square inherits rect or rect inherits square, always inherit rect from square, as you are adding a paramater, a second size dimension. Square has sideLength. Rectangle has a second sid legnth. Things get a lot cleaner following that.

mj
Автор

These expalmes are everywhere, really programmers cannot find more intresting expalmes...

shayama
Автор

Thank you. As an amateur coder you have taught me tons. Thank you. Love your videos.

MrPauld
Автор

Hands down best coding channel on YouTube. Many thanks and keep em coming!

Shinbo
Автор

And another very clear, clever and successful teaching video. Thank you!

desarrollojava
Автор

Sounds like polymorphism to me. I've used polymorism twice to very good avail. Once in an undo/redo (stack based) system and once in a linked list of tokens. And all I can say is Thank God for it. And one thing I love about it is how it allows for future expansion. If I should add new token types or undo/redo types on the future, no sweat. I don't have to change a thing in either my containers or my base classes. I could even distribute the code as a library and never worry about users needing to change the base code.

davivify