4 ms·
Go's lack of generics however (except for special blessed built ins that are OK) forces some of those bad patterns however. Want to write a linked list that wo
by Zach_the_Lizard 10y ago
Go's lack of generics however (except for special blessed built ins that are OK) forces some of those bad patterns however.
Want to write a linked list that works on all types? Hope you like reflection or annoying code generation or copy and paste.
- dilap 10y agoor casting, which is a selective bit of loss of type safety (& a speed hit), but is what the std library linked list impl actually uses, and is what pre-generics java & objc used forever. it ain't great, but it ain't a disaster, either.
- Zach_the_Lizard 10y agoIt's 1990s coding in 2016. We have a better way, and even go implements it for certain special types.
- dilap 10y agoi'm not saying it's great, but it's the most practical thing in most cases in go, & it was missing from your list. whether or not go would be better with generics is still an open question imo.