Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Unless you rely on introspection, which happens a lot when your language does not support generics.


No, it really doesn't happen a lot. If it does, you're doing it wrong.


If you don't have parametric polymorphism, you only have two options to implement new containers: a new implementation for each type or using interface{}. The first leads to a lot of duplicate code, the latter requires you to use introspection to use safely.

So, it does happen a lot, or you are making duplicate code.


Or you just don't need polymorphic containers that often (other than the ones that go already gives you).




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: