<@U5NANKKA7> The mnemonic for java is PECS (Produc...
# getting-started
b
@ziad The mnemonic for java is PECS (ProducerExtendsConsumerSuper), cause extends marks covariance and super contravariance, if that helps
z
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.
out/in by themselves are intuitive to me so I can reason about them even if I don’t remember it by heart
b
Covariance refers to the more generic type to the less, from big to small and contravariance the opposite, thats where they come from
z
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).