3 ms·
So if generics in java don't do anything beyond 'get typechecked, and insert implicit casts.' the empty interface is enough for all use-cases in go?
by JepZ 9y ago
So if generics in java don't do anything beyond 'get typechecked, and insert implicit casts.' the empty interface is enough for all use-cases in go?
- masklinn 9y ago1. the empty interface does not do the first one, and thus does not allow writing typesafe structures and code 2. and it requires significant expense of explicit casts which are not just sanity checks (which is what they are in java, due to type system weaknesses)
- deleted 9y ago[deleted]
- int_19h 9y agoYes, in a sense that structured loops don't do anything beyond inserting implicit if/goto, and so the latter is enough for all use-cases.