3 ms·
Things like this is why I've always been a fan of LINQ. Not only do you get excellent first class language support for writing and composing queries, you also g
by spion 4y ago
Things like this is why I've always been a fan of LINQ. Not only do you get excellent first class language support for writing and composing queries, you also get a very good typechecker to ensure that stuff are the right shape.
- pragmatic 4y agoAt my previous job, the founder did everything in Linq. He created a reporting engine in EF6 with Linq. Reports were run against the OLTP db. All queries were in LINQ. LINQ is a nightmare in these scenerios. Imagine 10s to 100s to 1000s of lines of indecipherable LINQ. We spent so much time debugging these things and trying to make them performant. After he sold the company I began replacing the LINQ garbage with inline queries with dapper when appropriate. So satisfying to see queries go from minutes to seconds to unmeasurable in SSMS. The problem with LINQ is it's upside down and backwards to people who know SQL. You can easily create horrible queries and unless you're an expert in both LINQ and SQL you'll have no idea how to fix it. There problem was it was difficult in many cases to get LINQ to create performant SQL, when writing a simple(r) query was both shorter and faster. We regularly hit the recursion limit in SQL Server and other errors I had honestly never seen in all my time using SQL Server.
- spion 4y agoThe idea is good, the implementation isn't quite ideal. Its possible to fully model SQL as it is with a query builder in a 1:1 unambigous manner, in a way where absolutely nothing about "plain SQL" is faster. I know SQL. I don't think LINQ is upside-down and backwards.