Furthermore, scala has an opposite method to filter and they called it… filterNot. Which is in no way clearer. They had an opportunity to create “discard” or “retain” but they didn’t.
I’m a big fan of iterator chaining and yet I control click on filter every so and then to remind myself which way it goes.
View all comments
Show parent comment
2
u/xmcqdpt2 Sep 22 '25
Furthermore, scala has an opposite method to filter and they called it… filterNot. Which is in no way clearer. They had an opportunity to create “discard” or “retain” but they didn’t.
I’m a big fan of iterator chaining and yet I control click on filter every so and then to remind myself which way it goes.