|
|
|
|
|
by eptcyka
3407 days ago
|
|
Whenever I evaluate a language past the hello world stage, I try to do something more complex. Which is where the generics come in.
Imagine for a second that I may want a hashmap with a custom key/hash function (most often it would actually be a set) for my own datatype. I can't just use the built in hashmap _language construct_ (the hashmap is it's own, very special type), I either have to write a hashmap implementation myself or wrap a hashmap in it's own type and have custom getters and setters which would extract a key from my custom type that is intended to be stored in the map. It might be more go to do said things, but then it just means that it's more go to write code that is more likely to be buggy. |
|