4 ms·
I have a deep hatred of Go for all the things it doesn't have, including a usable type system (if I cannot write SomeClass<T where T extends HorsePlay> or simil
by tomjen3 1y ago
I have a deep hatred of Go for all the things it doesn't have, including a usable type system (if I cannot write SomeClass<T where T extends HorsePlay> or similiar, the type system is not usable for me).
For NodeJS development, you would typically write it in Typescript - which has a very good type system.
Personally I have also written serverside C# code, which is a very nice experience these days. C# is a big language these days though.
- bccdee 1y agoFYI, newer versions of Go do support the following type HorsePlay interface { Neigh() } type SomeClass[T HorsePlay] struct { players []T } func (sc SomeClass[T]) NeighAll() { for _, p := range sc.players { p.Neigh() } } type Horse struct{} func (h Horse) Neigh() { fmt.Println("neigh!") } func main() { sc := SomeClass[Horse]{players: []Horse{{}, {}, {}}} sc.NeighAll() }