Say it like this
- We're using inheritance to avoid code duplication.
- The child class inherits from the parent class.
- Deep inheritance hierarchies make the code harder to maintain.
Use it at work
Code review
- Let's use composition instead of inheritance here.
- This inheritance chain is five levels deep. It's hard to follow.
Explaining
- The class inherits from BaseService, so it gets logging for free.
- With inheritance, child classes share the same methods.
In an interview
- When would you avoid inheritance?
- Inheritance is one of the four OOP principles.
Don't say this
Inheritance in tech has a completely different meaning from the everyday English word.
Don't mix it up
| Term | What it is | Who writes or uses it | When |
|---|---|---|---|
| inheritance | Class gets behavior from a parent class | Developers | OOP |
| composition | Class uses other objects to do work | Developers | Often preferred |
| polymorphism | One interface, many forms | Developers | OOP |
Practice
Try it
4 quick exercises
1. The Employee class _______ properties and methods from the Person class.
2. Which sentence uses inheritance incorrectly?
3. Your colleague asks about your class structure. How do you respond?
4. Rewrite this using inheritance naturally: 'The Admin class gets all the same methods as User, plus some special ones.'
Say it out loud
Phrase 1 of 3
"We're using inheritance to avoid code duplication."
We don't save your recording. The word check uses your browser's speech recognition.
More about inheritance
Real examples(3)
- in a standup
"I finished implementing inheritance for the User and Admin classes so we don't duplicate authentication code."
- in a code review
"This design uses inheritance well because the Vehicle class provides common properties for Car and Truck."
- in a team meeting
"We need to reconsider our inheritance structure because it has too many levels and is becoming difficult to test."
More mistakes(2)
Handle with care. Do not confuse with the general English meaning of inheriting money or property. In tech, it is purely about class hierarchies and code reuse.
- ✕We inheritance this code from the legacy system.✓We inherited this code from the legacy system.
Inheritance is a noun, not a verb. The past tense verb form is inherited.
- ✕The inheritance allows code duplication.✓Inheritance prevents code duplication by allowing reuse.
Inheritance is designed to reduce, not create, duplication.
Other forms(4)
- inheritance noun
"Inheritance is a pillar of object-oriented design."
- inherit verb
"The Dog class inherits from the Animal class."
- inherited verb (past tense)
"We inherited the logging functionality from the base class."
- inherited adjective
"The inherited methods are available to all subclasses."
Often used with(6)
- single inheritance · When a class inherits from one parent class only.
- multiple inheritance · When a class inherits from more than one parent class (not supported in all languages).
- inheritance hierarchy · The structure of parent-child relationships between classes.
- deep inheritance · Too many levels in the inheritance chain, which can create maintenance problems.
- override inheritance · To replace a parent class method with a child class version.
- inherit from · The preposition used to describe which class you are inheriting from.
Similar words(2)
- subclassing · A more technical term for creating a subclass that inherits from a parent class.
- extension · Some languages use extend instead of inherit, but the concept is the same.
Opposites(2)
- composition
- delegation
Questions(5)
- What does inheritance mean in software engineering?
- Inheritance is an object-oriented programming concept where a child class automatically receives methods and properties from a parent class. This allows developers to reuse code and build hierarchical relationships between classes without duplicating functionality.
- How do you use inheritance in a sentence at work?
- You might say: We used inheritance to share authentication logic between the Admin and User classes. Or: The child class inherits all methods from the parent class and can override them if needed.
- Is inheritance formal or informal?
- Inheritance is neutral in formality. It is the standard technical term used in both casual code reviews and formal architecture documents.
- What is the difference between inheritance and composition?
- Inheritance creates an is-a relationship (a Dog IS-A Animal), while composition creates a has-a relationship (a Car HAS-A Engine). Many teams now prefer composition because it is more flexible and avoids deeply nested class hierarchies.
- Why do we use inheritance?
- Inheritance reduces code duplication, creates logical class hierarchies, makes code more maintainable, and allows polymorphism. However, overusing inheritance can create complex hierarchies that are harder to test and modify.



