Click here to Skip to main content
15,882,209 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Wordle 986 Pin
Sander Rossel29-Feb-24 21:37
professionalSander Rossel29-Feb-24 21:37 
GeneralRe: Wordle 986 Pin
ChandraRam29-Feb-24 21:53
ChandraRam29-Feb-24 21:53 
GeneralRe: Wordle 986 Pin
Cp-Coder1-Mar-24 0:12
Cp-Coder1-Mar-24 0:12 
GeneralRe: Wordle 986 Pin
StarNamer@work1-Mar-24 2:45
professionalStarNamer@work1-Mar-24 2:45 
GeneralRe: I did it Pin
MarkTJohnson29-Feb-24 9:10
professionalMarkTJohnson29-Feb-24 9:10 
GeneralRe: I did it Pin
pkfox29-Feb-24 22:25
professionalpkfox29-Feb-24 22:25 
GeneralRe: I did it Pin
HobbyProggy29-Feb-24 23:26
professionalHobbyProggy29-Feb-24 23:26 
General.NET's Sometimes Nonsensical Logic Pin
Peter Moore - Chicago29-Feb-24 4:53
Peter Moore - Chicago29-Feb-24 4:53 
Someone really should start a weekly blog of inane .NET logic when it comes to what it does or does not throw an exception for vs. just behaving according to some default arbitrary choice.

Entry #1:

On an empty collection, .Any(), with our without a condition, always returns false, as any sane person would expect.

However, .All(condition), on an empty collection, returns true.

HUH?

If I look at an empty room and ask "Are all the people in there aliens?" the answer I expect is apparently YES?

If ever there were a situation where a method call is so nonsensical that there is no possible objectively right way to handle that which everyone would agree on (thus justifying an Exception), it's asking about All the items in an empty collection. It's tantamount to division by zero.

And yet on a null collection, even though these are all extension methods and perfectly capable of treating null as empty, it throws .NET's all time favorite and #1 most useless exception, NulLReferenceException.

Clearly the .NET developers' goal is to ruin as many of my days as possible.
GeneralRe: .NET's Sometimes Nonsensical Logic PinPopular
PIEBALDconsult29-Feb-24 5:09
mvePIEBALDconsult29-Feb-24 5:09 
GeneralRe: .NET's Sometimes Nonsensical Logic Pin
Peter Moore - Chicago29-Feb-24 8:00
Peter Moore - Chicago29-Feb-24 8:00 
GeneralRe: .NET's Sometimes Nonsensical Logic Pin
PIEBALDconsult29-Feb-24 8:26
mvePIEBALDconsult29-Feb-24 8:26 
GeneralRe: .NET's Sometimes Nonsensical Logic Pin
Peter Moore - Chicago29-Feb-24 8:45
Peter Moore - Chicago29-Feb-24 8:45 
GeneralRe: .NET's Sometimes Nonsensical Logic Pin
haughtonomous1-Mar-24 1:05
haughtonomous1-Mar-24 1:05 
GeneralRe: .NET's Sometimes Nonsensical Logic Pin
PIEBALDconsult1-Mar-24 4:47
mvePIEBALDconsult1-Mar-24 4:47 
GeneralRe: .NET's Sometimes Nonsensical Logic Pin
dandy7229-Feb-24 5:31
dandy7229-Feb-24 5:31 
GeneralRe: .NET's Sometimes Nonsensical Logic Pin
OriginalGriff29-Feb-24 6:03
mveOriginalGriff29-Feb-24 6:03 
GeneralRe: .NET's Sometimes Nonsensical Logic Pin
Richard Deeming29-Feb-24 6:04
mveRichard Deeming29-Feb-24 6:04 
GeneralRe: .NET's Sometimes Nonsensical Logic Pin
Peter Moore - Chicago29-Feb-24 8:02
Peter Moore - Chicago29-Feb-24 8:02 
GeneralRe: .NET's Sometimes Nonsensical Logic Pin
Richard Deeming29-Feb-24 21:27
mveRichard Deeming29-Feb-24 21:27 
GeneralRe: .NET's Sometimes Nonsensical Logic Pin
theoldfool29-Feb-24 23:36
professionaltheoldfool29-Feb-24 23:36 
GeneralRe: .NET's Sometimes Nonsensical Logic Pin
Peter Moore - Chicago1-Mar-24 2:39
Peter Moore - Chicago1-Mar-24 2:39 
JokeRe: .NET's Sometimes Nonsensical Logic Pin
Richard Deeming3-Mar-24 21:22
mveRichard Deeming3-Mar-24 21:22 
GeneralRe: .NET's Sometimes Nonsensical Logic Pin
Peter Moore - Chicago29-Feb-24 8:03
Peter Moore - Chicago29-Feb-24 8:03 
GeneralRe: .NET's Sometimes Nonsensical Logic Pin
haughtonomous1-Mar-24 1:10
haughtonomous1-Mar-24 1:10 
GeneralRe: .NET's Sometimes Nonsensical Logic - Platoon version Pin
David On Life1-Mar-24 9:52
David On Life1-Mar-24 9:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.