4 ms·
I think probably you should think of genericity as a style and like say, OOP this style can be supported by language features but you can insist on writing BBC
by tialaramex 5y ago
I think probably you should think of genericity as a style and like say, OOP this style can be supported by language features but you can insist on writing BBC Basic in an OO style, the language just gets in your way all the time.
So you could insist on doing generic programming in Go 1.17 say, but it feels very awkward and is slower and anybody reviewing your code is probably going to say "This is the wrong way to use Go" whereas with 1.18 there are more places where this is a reasonable solution.
If you hate OOP, you can write a Java program that's just one main function, it will really suck but it isn't impossible. If you hate Functional Programming you could write SML that's all imperatives and again that's going to be possible but the language is fighting you.
Parametric Polymorphism isn't a style it's a feature, like Ad Hoc Polymorphism (e.g. C++ function overloading) or Subtype Polymorphism (C++ inheritance) which you could choose to use in your programs or not, but doesn't go away just because you aren't using it.