3 ms·
Does this have anything to do with covariance and contravariance in terms on CS ? I couldn't understand from the article what those terms mean in the context of
by delaaxe 6y ago
Does this have anything to do with covariance and contravariance in terms on CS ? I couldn't understand from the article what those terms mean in the context of vectors spaces.
https://en.wikipedia.org/wiki/Covariance_and_contravariance_(computer_science) https://en.wikipedia.org/wiki/Covariance_and_contravariance_...
- layoutIfNeeded 6y agoNo they are not related, except maybe in some vague metaphorical way.
- fchu 6y ago(See https://en.m.wikipedia.org/wiki/Covariance_and_contravariance_of_vectors https://en.m.wikipedia.org/wiki/Covariance_and_contravarianc... for more context) Yes, as the terms "co/contra-variance" loosely relate to how certain derived attributes "varies" when base attributes changes: - vectors: whether scalars scales in the same direction or not of the base vectors (ie is obtained through the base transformation matrix, or its inverse) - generics: whether generics of a subclass of T is interpreted as a subclass (same direction) or superclass (opposite direction) of a generics of T. (Maybe they all formally tie together through category theory? I don't know but would love to hear from someone more educated about it!)