@ziad The mnemonic for java is PECS (ProducerExtendsConsumerSuper), cause extends marks covariance and super contravariance, if that helps
z
ziad
09/12/2017, 4:39 PM
Thanks! š Actually my problem is maybe a linguistic one? My point was that I forget if the word ācovarianceā refers to out and ācontravarianceā refers to in, or if itās the other way around. Simply because both of those words are ones Iām not familiar with and have never used outside of this context.
ziad
09/12/2017, 4:39 PM
out/in by themselves are intuitive to me so I can reason about them even if I donāt remember it by heart
b
bamdmux
09/12/2017, 4:41 PM
Covariance refers to the more generic type to the less, from big to small and contravariance the opposite, thats where they come from
z
ziad
09/12/2017, 4:42 PM
Yeah, sorry I guess Iām not making myself clear. I fully understand their use case/functionality. My comment was just a tongue in cheek criticism of the actual words. For example, if someone was to say: āThis variable is covariantā, it doesnāt naturally come to me if he means itāll be produced or consumed. (As opposed to them saying this is an out variable).