Re:Variance in Java
by dmitryminkovsky on Thursday April 11, 2019 @10:29AM
(#19634866)
Great post, this is a tricky subject. I find myself referring to these diagrams from time to time: https://stackoverflow.com/a/33246935/741970
[ Parent
| on HN ]
That's a good explanation, but I've found it helps to write out examples on paper and test them by hand.
Re:Variance in Java
by dmitryminkovsky on Thursday April 11, 2019 @11:16AM
(#19635375)
Test them by hand in what sense? If you mean in simple cases on the computer, then why write them on paper? (I do love writing on paper, just not sure why here)
Test them in the sense of thinking it through by working through the cases, it's more to help internalize the idea.
And writing things down is forcing my mind to serialize and deserialize ideas, and I think that helps the process.
(I'm not actually doing this often for Java generics, but I've been working on some other type theory stuff and I found it helped me get beyond "I understand this" to "I now feel relatively fluent expressing these ideas.")
Re:Variance in Java
by dmitryminkovsky on Thursday April 11, 2019 @03:10PM
(#19638105)
Oh yeah, for sure. Thanks for clarifying.