Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

>LINQ has almost always been an anti-pattern

You mean "LINQ" as an input for ORM? or LINQ in general?

either way this is crazy claim.

There's shitton of projects where queries aren't complex and LINQ will make your life saner instead of this stringly typed hell called SQL.

Just check what ORM is generating for your queries and if it is a mess then write it manually and you're good to go.

This way you get both benefits: sane type system and performance.



LINQ in general is a very bad indicator if it isn't very restricted. I don't think it's a crazy claim whatsoever: When LINQ appears littered through code, it usually mean there has been perilously little data access planning, so instead of planning out and centralizing concise, planned, secure, optimized data access avenues, just pretend that LINQ being available everywhere is a solution. Every LINQ-heavy solution I've had the misfortune of using has always, with zero exceptions, been a performance nightmare. And instead of one big function you can just optimize, it is death by a trillion cuts.

I get that there are big LINQ advocates. It's convenient. I'm sure there are projects where it is use spectacularly. I've never seen such a project.


LINQ is just functional list comprehensions.

Do you think that LINQ is only used for EF/LINQ2SQL?


First time I’ve heard that claim was when I had to start working with Go. I was telling someone how much I miss LINQ/functional programming, and he said exactly the same thing “ugh, LINQ is why .NET is so slow”. I was perplexed. Do you even know what LINQ is? How does it make .NET slow? And to the best of knowledge they were comparing JIT startup time to Go’s AOT time. Smh


Yeah. The amount of FUD and ignorance out there in the technical world WRT the .NET ecosystem is astounding.


This comment make me question if you really have any experience with LINQ. If you had, you would not make a comment where you seem to think that LINQ is used only for data access.

LINQ is (at the most basic level) list comprehensions done better. It is functional programming for the imperative C# programmers. It has the potential to remove most/all loops and make the code more readable in the process.


>This comment make me question if you really have any experience with LINQ

The classic fallback.

>If you had, you would not make a comment where you seem to think that LINQ is used only for data access.

List comprehension is data access. Accessing sets in memory is data access.

>If you had, you would not make a comment where you seem to think that LINQ is used only for data access.

It has the potential, and almost the certainty, of allowing one to thoroughly shoot themselves in the foot. See without the "magic" of LINQ the grotesqueness of many patterns of data access (which, as previously mentioned, includes in memory structures. Pretty bizarre that anyone actually in this field thinks this only applies to databases, or that only DBs are "data") would lead one to rethink.

LINQ is almost always a bad indicator. It is actually a fantastic thing in one off scripts and hack type code, but when it appears in production code, I would say 90%+ of the time it is absolutely gross, but it hides how gross it actually is.


> LINQ is almost always a bad indicator. It is actually a fantastic thing in one off scripts and hack type code, but when it appears in production code, I would say 90%+ of the time it is absolutely gross, but it hides how gross it actually is.

Yeah, you definitely have no idea what LINQ, or an list, even is.


How is this gross then?

It is just a slightly slower than e.g fors, so unless this is hot path, then it is basically not relevant meanwhile it improves readability of the code




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: