“Inheritance has recently fallen out of favor as a programming design solution in many programming languages because it’s often at risk of sharing more code than necessary. Subclasses shouldn’t always share all characteristics of their parent class but will do so with inheritance. This can make a program’s design less flexible. It also introduces the possibility of calling methods on subclasses that don’t make sense or that cause errors because the methods don’t apply to the subclass. In addition, some languages will only allow a subclass to inherit from one class, further restricting the flexibility of a program’s design. For these reasons, Rust takes a different approach, using trait objects instead of inheritance.”
Quote by Steve Klabnik
Work
The Rust Programming Language
Browse quotes and source details for this work. more
Author
You May Also Like
“To share a table with someone is to share everything.”
Source: Steel Crow Saga
Source: The Girl Who Smiled Beads: A Story of War and What Comes After
“We all fare better when we can balance freely expressing and quietly listening.”
Source: Encouragement: How to Be and Find the Best
Source: Hit Makers: The Science of Popularity in an Age of Distraction
“The size of my life is not determined by how much I have, but how much I’ve chosen not to have.”
“Live significantly impacting and sharing your purpose so someone can find theirs.”
“Experience is a wonderful gem that should be cherished and shared!”
Source: Random Cosmos