3 ms·
Is there something about generics I'm missing? Other than during discovery, when do you have input that you cannot anticipate its type and you are forced to mo
by ChikkaChiChi 12y ago
Is there something about generics I'm missing? Other than during discovery, when do you have input that you cannot anticipate its type and you are forced to modify it?
- solipsism 12y agoI think you're missing something about generics, yes. Firstly, often you don't know the type you're working with because you're writing a generic library, made to be used generically. Secondly, often you want to write some generic data structures or algorithms and parameterize them over multiple known types, and generics help you avoid repeating yourself but maintain strong static typing.