Orhan Tozan
07/06/2022, 11:12 AM.filter { }
could have gotten a better name? Everytime I see .filter { }
, my brain has to stand still and figure out if it actually means "filter out" or not. I think .where { }
would have been a more easier name to scan and understand what it doesJavier
07/06/2022, 11:20 AMfilterNot
elect
07/06/2022, 11:49 AMjw
07/06/2022, 11:49 AMJavier
07/06/2022, 11:50 AMjw
07/06/2022, 11:50 AMjw
07/06/2022, 11:50 AMOrhan Tozan
07/06/2022, 11:51 AMJavier
07/06/2022, 11:51 AMwhere
is usualRoukanken
07/06/2022, 1:09 PMx.select { it.attribute }
does not make sense for me)
It's more of habit thing. And afaik .NET & databases are only languages using these "declarative" terms. Everything else uses the functional ones.Orhan Tozan
07/06/2022, 1:11 PM.select { }
is worse than map
i agree, but sure we can take the best of both worlds? (where and map)Zac Sweers
07/06/2022, 2:14 PMOrhan Tozan
07/06/2022, 2:21 PM.filter
is now where
, so that's why I would rather use filter
than where
as long as filter
is the standard inside the Kotlin community
So I agree with @jw to keep with a standard, but the question is what you refer to as the 'standard', so I am saying that it would be better if the stdl function name changed. But ofcourse it's too late for that now