The red apple streams one is good. It shows how developers chase shiny new stuff with no respect for fundamentals. They will say it's less code, and then show you more code.
>> apples.stream()
>> .filter (a -} ajsRed());
>> .forEach(giveApple); [sic]
> The red apple streams one is good. It shows how developers chase shiny new stuff with no respect for fundamentals.
The problem isn’t streams, it’s slop.
The apples one is LLM nonsense: the left example doesn’t include any code for the loop, whereas the streams version actually is iterating over a collection.
Regardless, FP-style code isn’t “shiny new stuff”—it’s been around for decades in languages like Lisp or Haskell. Functional programming is just as theoretically “fundamental” as imperative programming. (Not to mention that, these days, not even C corresponds that closely to what’s actually going on in hardware.)