logoalt Hacker News

el_pollo_diabloyesterday at 6:10 AM1 replyview on HN

If, by "situation", you mean the development of a small program with so many constraints that using existing libraries is out if the question, then yes.

Otherwise, that seems unwise to me. Not every user of a generic type has to be generic. A major selling point of generic types is that you write a library once, then everyone can instantiate it. Even if that is the only instance they need in their use case, you have saved them the trouble of reinventing the wheel.

No colleague of mine may need 10 different instances of any of my generic libraries, but I bet that all of them combined do, and that our bosses are happy that we don't have to debug and maintain 10+ different implementations.


Replies

monkeyeliteyesterday at 7:03 PM

Ok you’re telling me the upside which we already know. Now what’s the downside?

show 1 reply