by greggman2 · 7y ago · 0 comments
const people = list.stream();
const peopleOlderThan50 = people.filter(??);
const average = peopleOlderThan50.mapToInt().sum() / peopleOlderThan50.length;
Or some such thing. The more complex the chain the harder it is for me to read. Does anyone else have that experience?Also, for non-toy examples, there are real benefits to composing transformations, so that you don't pay the memory and performance costs of assigning intermediate sequences.