3 ms·
Ask HN: What proportion of generics usage is collection-y?
This is a question for those who use languages with generics: what percentage of generics use is for generic collection-y things (including Optional, Maybe, etc.) vs. other, non collection-y applicaions?
Use specifically includes using pre-existing types.
- scribu 7y agoA generic construct implies some sort of hierarchical relationship between two things, so the answer would always be 100%. Perhaps give some examples of "non-collectiony" applications in order to clarify your question.
- karmakaze 7y agoI took it to mean List<T> etc of standard or other container types vs aspect-typed etc (e.g. Persistable<User>).
- karmakaze 7y agoFalse dichotomy. I would say the ideal split is 100% / 100%. Use both always by representing your data generically and always supporting/using operations on their containers.
- frou_dh 7y agoYou'd probably get more satisfying answers by actually devising and running static analysis on some open source codebases