Member-only story
C# & .NET for Java/Spring Developers-3: LINQ vs Java Streams
If you’re coming from Spring Boot, you reach for Stream<T> any time you need to filter, map, or collect a list without writing a for loop. C# has had the same idea since 2007 — seven years before Java 8 brought in streams — it's just called LINQ (Language Integrated Query), and it works a bit differently under the hood.
In Part 2 we compared Task<T> and CompletableFuture<T>. This part stays in everyday code: transforming collections, which is probably a third of what you write in either language. The two models look nearly identical on the surface — .Where().Select().OrderBy() versus .filter().map().sorted() — but LINQ's deferred execution and its query-syntax alternative don't have a Streams equivalent, and Streams' single-use, closable pipelines don't have a LINQ equivalent either.
The Core Types: IEnumerable<T> vs Stream<T>
IEnumerable<T> has been part of .NET since 1.0; LINQ just bolted a huge set of extension methods (Where, Select, OrderBy, GroupBy, and about fifty others) onto anything that implements it, back in C# 3.0 / .NET 3.5. A Stream<T> is a newer, narrower idea: a one-time, possibly-parallel pipeline bound to a single source, introduced specifically for this purpose in Java 8.
public sealed record Order(int Id, string…







