News for hackers. Stuff that matters.
Re:Teeing, a hidden gem in the Java API by kitd on Monday May 10, 2021 @04:13AM (#27103771)
I think your point is valid with a trivial example as shown in the article.

In a more complex example, with multiple steps and potentially multiple streams, using the Streams API allows the algorithmic and business logic parts of the whole calculation to be kept separate, more visible and more maintainable/adaptable as a result. Imperative code in such cases usually involves factoring out chunks of the for-loop into separate functions or classes which IME goes in the opposite direction.

There are no comments on this comment yet.