Covariance and Contravariance @ChristopherOkhravi
Covariance and Contravariance  @ChristopherOkhravi
Uploaded March 2024 | Updated November 2026, 5 days ago
The intuition behind Covariance and Contravariance explained with apples 🍎, oranges 🍊, and cats 🐈.

💚 BUY MY BOOK:
theobjectorientedway.com

00:00 Question
00:41 Fruit example (Covariance)
01:14 Fruit example (Contravariance)
02:03 UML (Covariance)
03:24 UML (Contravariance)
04:53 Formal definitions
06:12 Type safety
07:16 Robustness Principle
08:20 Invariant list (Covariance)
09:43 Invariant list (Contravariance)
10:59 Invariant list (summary)
11:44 Where to use variance
12:57 Summary

(Reuploaded because of a mistake in the original upload)
Covariance and ContravarianceToo Many ParametersThe Square-Rectangle ProblemVariance and FruitsSubtypes Must Replace ConditionalsComposite Pattern DefinitionHigh Level Iterators replace Foreach | Code Walks 035Works VS ValuableRules Have Reasons (Always Ask Why)Reactive Programming from Scratch (JavaScript) - Ep3Impossible Is BetterDifferent algorithms or different values?
Christopher Okhravi |

Covariance and Contravariance

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER