These two terms are actually abstract mathematical concepts that are used in probability theory, statistics, theoretical physics, category theory and (you guessed it!) computer science. Each aforementioned field has a certain definition regarding what covariance / contravariance is. Each definition may or may not have a degree of similarity to the other definitions in the other fields.

During this talk, we’ll try to make sense of these things, together. We’ll lightly touch upon what covariance and contravariance means in a couple of applied mathematical scenarios (Don’t worry, we won’t be talking about functors!). Then, we’ll see how these concepts are used to describe subtyping relationships in programming languages such as Java and C#. There will be code examples, of course!

[who-for]

Alin Pandichi