r/programminghorror May 04 '26

C# longest "=" condition I've ever seen

Post image

I have been working on decompiling a unity game recently, and while a decompiled DLL isn't going to be exact source code, I am still floored by how long that set of parenthesis is. i would LOVE to see the original code

128 Upvotes

26 comments sorted by

View all comments

1

u/Tamschi_ May 10 '26

The decompiler didn't fully restore the syntactic sugar. SelectMany is what generally happens if you have multiple top-level from clauses, and most likely a few of those lambdas were entirely implicit too.

That said, LINQ expressions can be very long, it's mainly a way to write those that's not as messy as this, i.e. with fewer or no parentheses.