Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
Jifuna38452yLol, had something similar a few months ago the fucking ldap lib login function in php returns true if you provide an empty password wtf.
Just check before and wrap it into an extension method... i did the same with sum and average as they throw Exceptions on empty enumerables.
Brolls34172yYeah. This has caught me out a few times and it makes me rage constantly.
I genuinely don’t understand why they made this decision, it’s so stupid.
I guess at a stretch you can say that yes, the predicate does apply to all elements of the set because the set is empty, but it’s so fucking counterintuitive.
Krichel272yNever seen any implementation that would return false. If a predicate is true for all elements in a set, it should not magically become false when you remove 1, 2, .., all elements.