> Non-sequitur here. To me, it's clear that I'm saying that generics are overrated and overused. Your interpretation makes no sense!
Ok, now I understand what you're saying. As an aside, I would suggest that most people (as is evident in this comment thread) would not interpret your statement the way you intended.
>> For languages like Java, the problem is that functions are not first class - you can't directly pass along a method/function like (Conf -> SomeService), so instead, it's common to create some special type, like SomeServiceFactory.
> Another non-sequitur here. Factory pattern was originally popularized in the GoF book as a way of providing an opportunity for polymorphism.
I agree (re: polymorphism), but I don't think that contradicts what I'm saying; functions with parametric polymorphism (with support for {co,contra,in}variance) provide the same benefits of class polymorphism in this context.
> Old hand at Smalltalk here -- over 10 years. You don't often see Factory classes in Smalltalk. We also have very easy and nimble closures over variables in the context they're defined. I still don't get what you're on about.
You're absolutely correct. However, my point was that in statically typed languages, generics are conducive to favoring closures over factories classes and inheritance. But, now I realize that we were arguing two different things.
You are making the non-sequitur. His interpretation is the only one that makes sense. It is not clear at all that you are saying what you claim you are saying. You are in fact not saying anything like it. You are saying two things you don't like happen with generics, but that is completely false.
So you are trolling, and you still haven't pointed out such a rule.
> Inheritance is overrated, and the factory pattern is often overused. Both of those happen with generics.
Non-sequitur here. To me, it's clear that I'm saying that generics are overrated and overused. Your interpretation makes no sense!
For languages like Java, the problem is that functions are not first class - you can't directly pass along a method/function like (Conf -> SomeService), so instead, it's common to create some special type, like SomeServiceFactory.
Another non-sequitur here. Factory pattern was originally popularized in the GoF book as a way of providing an opportunity for polymorphism.
If, for comparison, you take a look at Scala/Haskell/C#/etc, you'll wont often spot /.Factory/ anywhere, because a function (with the ability to close over free variables) is much more concise*
Old hand at Smalltalk here -- over 10 years. You don't often see Factory classes in Smalltalk. We also have very easy and nimble closures over variables in the context they're defined. I still don't get what you're on about.