4 ms·
"SQL is a very old language—invented in 1974." Not a good start. SQL is still in widespread use 43 years later because of how good it is. It's not a legacy wei
by skywhopper 10y ago
"SQL is a very old language—invented in 1974."
Not a good start. SQL is still in widespread use 43 years later because of how good it is. It's not a legacy weighing us down. Rather it has consistently proven its usefulness over and over again. Some of the constructs can feel awkward to be sure. But part of our impression of awkwardness is really just due to SQL's declarative nature, which makes the structure of queries look a lot different than the procedural languages we spend most of our time in.
But it's not clear to me from this article that LINQ is even anything different that what already exists in most every modern application platform. It provides a cleaner syntax for some subset of common query patterns. Okay. There's a ton of SQL generators out there. Is LINQ doing something _else_ for us? This article doesn't say. I don't know, and I didn't learn that from this article.
If you use C# or VB to write apps against relational databases, then by all means, use this to write your SQL. But don't pretend the SQL isn't there or isn't important. LINQ just places you one more potentially leaky abstraction away from your dataset.
- eeperson 10y ago> SQL is still in widespread use 43 years later because of how good it is. It's not a legacy weighing us down. I'm rather dubious of this claim. This is kind of like claiming the reason we use Javascript is because of how good it is. The awkwardness of SQL is not because it is declarative, otherwise LINQ would have the same awkwardness because it is also declarative. I think the real reason SQL is because database vendors have not made an effort to add support for other languages.
- Daishiman 10y agoBS. It's a language that can barely express subqueries and query aliases. Every ORM has shorthand syntax for expressing filters and order by statements that's way better than the SQL equivalents. It's barely composable. Do you want to build a query dynamically based on a set of conditions. Tough luck, use a query builder that's prettier anyway. Its syntax is not amenable to autocompletion. Join syntax is ugly on the eyes and hard to indent. Seriously, let's kill the love for SQL. I'd rather read queries written in EF Codd's original relational algebra syntax (https://en.wikipedia.org/wiki/Relational_algebra https://en.wikipedia.org/wiki/Relational_algebra) rather than embedding the abortion that is SQL in my code.