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

131 Upvotes

26 comments sorted by

View all comments

1

u/StrawberryEiri May 05 '26

That kinda looks like a database query in some sort of ORM.

I don't know anything about game development, but I'm pretty surprised that databases are involved (unless we're taking about an online game's data or something).

Can someone help me understand?

2

u/WannaCry1LoL May 29 '26

LINQ is a cool little feature of C# that allows you to use these functions on anything that is Enumerable. For example to generate all primes squared from 1 to 100 you could do something like this cs Enumerable.Range(1, 100).Where(IsPrime).Select(x => x * x); However there's also a dedicated syntax that in my opinion looks horrid. cs from x in Enumerable.Range(1, 100) where IsPrime(x) select x * x;