Lambdas, what are they good for? Absolutely nuthin!
In what world is this clear expression:
listWithContinuation(result2, prices, marketLines, marketMore, new Function<String,String>(){
@Override
public String apply(String idlvl) {
return idlvl + " " + numbers.get(idlvl) + " for " + prices.get(idlvl) + "© each";
}
});
Improved on by this lambda gobbledygook:
listWithContinuation(result2, prices, marketLines, marketMore,
idlvl -> idlvl + " " + numbers.get(idlvl) + " for " + prices.get(idlvl) + "© each");
I understand I have had to do less typing in the lambda, but I hate introducing an identifier (idlvl) in my code without declaring its type. I like to see that I’m implementing a string formatting Function and passing it into a method.
Does it have any advantages aside from being more terse? I don’t think any programmer is bottlenecked by their typing speed Doesn’t it produce the same bytecode either way?
It goes against my grain as a programmer, but if I don’t get the hang of them will I still be able to hang out with the cool kids?