3 ms·
As one of those old timers that don’t like Java’s Generics, they are what caused me to stop wanting to use Java. IMO they are terrible for code clarity. Thoug
by parasubvert 6y ago
As one of those old timers that don’t like Java’s Generics, they are what caused me to stop wanting to use Java. IMO they are terrible for code clarity. Though I prefer loose typed languages in general.
Now they’re invading Golang. I’m happy they’re taking their time.
- willtim 6y ago"Generics" (a.k.a. parametric polymorphism) might be terrible for code clarity in a verbose language with subtyping and little to no type inference, but in many languages they actually improve code clarity: map : (A -> B) -> [A] -> [B] It's quite clear from the above type signature what this function does and does not do. It can only use the supplied A's to create B's using the supplied function. It cannot do anything else with the A's and the B's. To me, that is clarity.
- parasubvert 6y agoThis is true. But care must be taken with the feature. Iirc, Java Generics tried to take their time but refused to adopt more (at the time) exotic type inference to simplify the syntax.
- crazy5sheep 6y agowithout generic support, Go couldn't even provide things as simple as a Max(...) function for all kinds of numbers in their standard library.
- parasubvert 6y agoThis never bothered me as it is trivial. But clearly it bothers some people.