Marcin Wisniowski
09/12/2026, 6:35 AMfilter { it.id != id }
vs
filterNot { it.id == id }
?
I find myself rarely using the *Not variants of stdlib functions because it's longer than just inverting the predicate inside, and is also sligthly harder to read because you have to read the original predicate only to have to invert it in your mind. Only cases where I find them useful is when passing in a function reference (filterNot(::predicate)).Joffrey
09/12/2026, 6:50 AMfilterNot when the predicate is just it.isSomeBooleanPropertyDanielZ
09/12/2026, 8:13 AM*Not functions, because it’s harder to overlook while scanning code. Together with function references it’s powerful to describe your intend from domain perspective.