News for hackers. Stuff that matters.
Re:Go is Google's language, not ours by jimmaswell on Wednesday May 22, 2019 @04:32PM (#19985143)
This is the only non-bad consequence of type erasure I'm aware of. On the other hand, a lot of code I've written in C# would be impossible or severely hacky without type retention, like "new T()", "T is Thing", finding all classes that are derived from T, etc.
Re:Go is Google's language, not ours by eropple on Wednesday May 22, 2019 @04:35PM (#19985176)
TBH, I'm just as happy passing a factory method in for that sort of thing. Because it allows you to do both and pick the one that makes the most sense for you in a given situation.