4 ms·
Only it doesn't. The examples given _compile_ to SQL. So you're not comparing LINQ with SQL but LINQ-to-SQL (or the entity stuff) with SqlCommand. SQL's a pret
by moomin 10y ago
Only it doesn't. The examples given _compile_ to SQL. So you're not comparing LINQ with SQL but LINQ-to-SQL (or the entity stuff) with SqlCommand.
SQL's a pretty grim language, but it's the only language the database understands as a first-class citizen. Until someone designs a new foundation (like WebASM is doing), the rest is just syntactic sugar.
- skissane 10y ago> SQL's a pretty grim language, but it's the only language the database understands as a first-class citizen. Until someone designs a new foundation (like WebASM is doing), the rest is just syntactic sugar. SQL is an ugly COBOLesque veneer over an elegant relational calculus core. But the "new foundation" you speak of already exists, and has for decades. Competing query languages based on relational calculus are less ugly – QUEL, D, etc. Sadly, those better looking query languages have failed in the marketplace–ugly SQL won.
- rrdharan 10y agoI'm kind of curious why there aren't wrappers / APIs / libraries for these other query languages that convert them to SQL at execution time. Arguably that is what LINQ is anyway.. Perhaps these options exist and I've just never encountered them? It's surprising that what I most often seem to encounter in casual discussion is this sophie's choice dichotomy between using SQL directly versus an ORM.
- cwyers 10y agoI have looked at D, and read some of CJ Date's books. As far as I can tell, D doesn't solve any of the actual problems with SQL, like composibility and code reuse, and just solves Date's imagined problems about not following relational theory close enough.
- emmelaich 10y agoYeah, in my db class at Uni we learnt QUEL before we touched on SQL. It was clear then that QUEL was better in a number of ways. https://en.wikipedia.org/wiki/QUEL_query_languages https://en.wikipedia.org/wiki/QUEL_query_languages
- johnnyhillbilly 10y agoI believe the first thing to understand about SQL is that everything is a table (aka relation). Once one understands that, the idea of modelling entities as relations and relationships as references starts making sense. Also, the tenets of normalization become understandable on an intuitive level. Sadly, many IT professionals lack the intuition on this. SQL is a highly sophisticated language since many years. Having done insane amounts of data prepping and validation for analytics, I will attest to this. However, if I am writing software in .NET, I would trade away SQL for LINQ any day of the week. (Preferrably by means of some sort of intuitive DAL.)
- pharrington 10y agoThis may just be because I'm not a database expert, but it seems weird to me that after all these years Microsoft hasn't written a native LINQ driver for SQL Server.