But then I tried to think of a code where I would rather use this than a list comprehension or yield and a more manual control flow.
And I couldn't.
Those streams are elegant when the business logic flows perfectly like a river. Unfortunately, reality is messy, and production code will have matching, conditions, casting, extractions and transformations all over the place, leading to:
- very long chains of calls
- hard to change code when feedback pushes for it
- limiting your tooling (specially debuggers) to stuff that have exceptional support of chaining, and it's rare