News for hackers. Stuff that matters.
Re:Writing good code: how to reduce the cognitive load of yo... by jmcomets on Friday March 10, 2017 @04:55AM (#13837506)
I agree with you that `filter` is less explicit than something like `copy_if` (C++).

Does it return elements matching the predicate or not matching it? I struggled with this for a while in CS.

After learning different programming languages and getting some field experience I noticed that the `filter` pattern is pretty common in the programming world. It's one of those pervasive functional patterns that are so practical that they were included at some point in imperative languages.

There are no comments on this comment yet.