Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Jifuna37267yLol, 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.
-
Brolls31157yYeah. 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. -
@Brolls Wikipedia says that the universal quantification of the empty set is by convention always true.
-
Krichel237yNever 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.
Related Rants
"By design, the All operator returns true for an empty sequence."
You cunt face!
devrant
c#
linq
swearing