Hacker News new | ask | show | jobs
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.
1 comments

I definitely agree with you that I prefer having generics to not having them and would consider that in my evaluation of a language; I just found it strange that a random reference to the lack of generics was dropped in the middle of an otherwise cohesive description of the pros and cons of the "hello world" experience.