Click here to Skip to main content
15,890,043 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: It's buzzword bingo time! Pin
sasadler17-Feb-21 7:26
sasadler17-Feb-21 7:26 
GeneralRe: It's buzzword bingo time! Pin
matblue2517-Feb-21 12:45
professionalmatblue2517-Feb-21 12:45 
GeneralFood-for-Thought (of the day) Pin
W Balboos, GHB16-Feb-21 7:16
W Balboos, GHB16-Feb-21 7:16 
GeneralRe: Food-for-Thought (of the day) Pin
Greg Utas16-Feb-21 8:29
professionalGreg Utas16-Feb-21 8:29 
GeneralRe: Food-for-Thought (of the day) Pin
W Balboos, GHB16-Feb-21 8:33
W Balboos, GHB16-Feb-21 8:33 
GeneralRe: Food-for-Thought (of the day) Pin
Cp-Coder16-Feb-21 14:20
Cp-Coder16-Feb-21 14:20 
GeneralRe: Food-for-Thought (of the day) Pin
W Balboos, GHB17-Feb-21 1:13
W Balboos, GHB17-Feb-21 1:13 
RantAnother reason I don't like LINQ Pin
honey the codewitch16-Feb-21 5:07
mvahoney the codewitch16-Feb-21 5:07 
Here's my error

System.ArgumentNullException: 'Value cannot be null.
Parameter name: values'

... for this mess:
C#
Columns.AddRange(obj.GetType().GetGenericArguments().FirstOrDefault()?.GetProperties().Where(p =>
{
    return p.GetCustomAttributes(true).OfType<BrowsableAttribute>().FirstOrDefault()?.Browsable ?? DefaultBrowsableState;
}).Select(p =>
{
    return new ColumnHeader()
    {
        Name = p.Name,
        Text = p.GetCustomAttributes(true).OfType<DisplayNameAttribute>().FirstOrDefault()?.DisplayName ?? p.Name
    };
}).ToArray());


The thing is, I know what it's trying to do, and the code makes sense to me even though I didn't write it. The LINQ isn't really that bad here. But the error message is just awful. I don't even know where to begin. Time to hand roll the same statement LINQless so I can debug it.

So consider this my part 2 in why LINQ is for the birds.
Real programmers use butterflies

GeneralRe: Another reason I don't like LINQ Pin
Slacker00716-Feb-21 5:20
professionalSlacker00716-Feb-21 5:20 
GeneralRe: Another reason I don't like LINQ Pin
honey the codewitch16-Feb-21 7:02
mvahoney the codewitch16-Feb-21 7:02 
GeneralRe: Another reason I don't like LINQ Pin
Jörgen Andersson16-Feb-21 9:45
professionalJörgen Andersson16-Feb-21 9:45 
GeneralRe: Another reason I don't like LINQ Pin
Greg Utas16-Feb-21 5:25
professionalGreg Utas16-Feb-21 5:25 
GeneralRe: Another reason I don't like LINQ Pin
honey the codewitch16-Feb-21 7:05
mvahoney the codewitch16-Feb-21 7:05 
GeneralRe: Another reason I don't like LINQ Pin
Daniel Pfeffer16-Feb-21 7:17
professionalDaniel Pfeffer16-Feb-21 7:17 
GeneralRe: Another reason I don't like LINQ Pin
Gerry Schmitz16-Feb-21 6:02
mveGerry Schmitz16-Feb-21 6:02 
GeneralRe: Another reason I don't like LINQ Pin
Richard Deeming16-Feb-21 6:05
mveRichard Deeming16-Feb-21 6:05 
GeneralRe: Another reason I don't like LINQ Pin
honey the codewitch16-Feb-21 6:53
mvahoney the codewitch16-Feb-21 6:53 
GeneralRe: Another reason I don't like LINQ Pin
Sander Rossel16-Feb-21 10:26
professionalSander Rossel16-Feb-21 10:26 
GeneralRe: Another reason I don't like LINQ Pin
musefan16-Feb-21 6:06
musefan16-Feb-21 6:06 
GeneralRe: Another reason I don't like LINQ Pin
obermd16-Feb-21 6:13
obermd16-Feb-21 6:13 
GeneralRe: Another reason I don't like LINQ Pin
Gerry Schmitz16-Feb-21 6:35
mveGerry Schmitz16-Feb-21 6:35 
GeneralRe: Another reason I don't like LINQ Pin
Marc Clifton16-Feb-21 11:13
mvaMarc Clifton16-Feb-21 11:13 
GeneralRe: Another reason I don't like LINQ Pin
Matthew Dennis16-Feb-21 7:41
sysadminMatthew Dennis16-Feb-21 7:41 
GeneralRe: Another reason I don't like LINQ Pin
honey the codewitch16-Feb-21 7:48
mvahoney the codewitch16-Feb-21 7:48 
GeneralRe: Another reason I don't like LINQ Pin
Slacker00716-Feb-21 9:06
professionalSlacker00716-Feb-21 9:06 

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.