Piet Souris wrote:And some experience in writing Comapators is then a nice thing to have.
It's not
Comparators as much as
Collectors that I have a problem with. The whole business seems very "clunky" to me (although I'm sure Stephan will tell me different).
I was also trying to point out that when you're dealing with functions, you may have to "think" differently (although I'm on slightly shaky ground here).
In procedural code, we might create a
Map simply because it's useful for all sorts of things we
might want to do, and doesn't cost much in terms of execution time; but here we have a very specific task:
Get the longest Strings from a bunch.
And to me, that boils down to:
and
then you can decide how you "supply" or "collect".
Winston