Introduction
The Liskov Substitution Principle (LSP) is a foundational concept in object-oriented design, introduced by Barbara Liskov i...
For further actions, you may consider blocking this person and/or reporting abuse
Not that I care, I think inheritance just ruins codebases anyway, but a nitpick: a square is a rectangle. The second code snippet (the solution) fails that check.
Agreed. But dont you think inheritance makes our lives a bit easier? We have to write a bit less code and enjoy being lazy....
After many years of digesting many kinds of codebases, I'm definitely a "composition over inheritance" kind of person...
Sharing things by inheritance eventually bites you when you have to change a base behavior but just for some of the classes instead of all of them.
Good job explaining something relatively complex in such a nice and simple way, as someone who has interviewed a lot of developers throughout my career I can honestly say this is something people always struggle to articulate beyond reciting the "dictionary definition" during interviews
Thanks! I hope you like this article. Follow for more such contents
Hi, thanks for sharing!
I'm glad you liked it
Thanks for reminding!
Thanks! if you liked the content pls give a thumbs up for upcoming articles
Very good article 👍
Thank you @richard_ekeopara_84627a31
Very good example
I'm glad that you liked it