3 ms·
I think the example here comes from "exaggeration for effect". On the other hand, you certainly have a number of factories in Java-land, mostly because that's w
by mercurial 12y ago
I think the example here comes from "exaggeration for effect". On the other hand, you certainly have a number of factories in Java-land, mostly because that's what you do when you don't have currying and you want to fix the value of some parameters in a constructor.
That said, I suspect the author is not that familiar with Java, considering that using an enum would not take more space and would be way more idiomatic than hand-rolled integers. Also, the Java folks found out about type inference, which should be pointed out in any article about Java lambdas.
- seanmcdirmid 12y agoWe have lambdas in C# land, and I don't find myself using factories or lambdas in my code. I occasionally take advantage of reified generics and reflections, but that is a different thing.
- mercurial 12y ago> We have lambdas in C# land, and I don't find myself using factories or lambdas in my code. I do some C# too, and I use lambdas regularly with .Select() (but not so much otherwise - though I can imagine it's an effect of the codebase). But you do need factories/providers if you want IoC and you use variables in different scopes...
- seanmcdirmid 12y agoI'm sorry, I meant, I don't find myself using lambdas to curry constructor arguments. I didn't mean I don't use lambdas at all (of course, I use them a lot within reason, sometimes I have to go back and de-lambdify my code for debugging or perf reasons).