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

I tend to use generics alongside reflection a lot, for example I might use a Mapper<TFrom, TTo> when mapping between different representations (an object and associated service contract being one example).

The mapper can take care of almost everything using a few conventions and reflection, and for anything where those conventions don't cover it you plug in a little custom code (inherit from Mapper<,> or use composition).

Not sure how you’d handle that sort of case in Go without generics?



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

Search: