News for hackers. Stuff that matters.
Re:“Coding is basically just ifs and for loops.” by RHSeeger on Saturday December 04, 2021 @10:48PM (#29446536)
The code he posted isn't actually valid because you can't "orElse" a list. That being said, I would presume it was meant to include a "findFirst". Something like

    list.stream().filter(Objects::nonNull)
        .map(User::getUsername).filter(Objects::nonNull)
        .findFirst(name -> name.contains(searchString))
        .map(name -> “We have found your user: “ + name)
        .orElse(“We haven’t found”);
Re:“Coding is basically just ifs and for loops.” by peoplefromibiza on Sunday December 05, 2021 @04:40AM (#29447997)
exactly, that was the catch.

the point I wanted to make is that the snippets presented seem carefully crafted to make pipelines look bad, but usually that's not the case.