What is so scary about DLINQ?
I read an interesting piece by Jon Galloway titled "LINQ looks good, but DLINQ scares me", which was intriguing from the outset.
Why is DLINQ scary I wondered?
All manner of visions came to mind, I admit.
On a surface level, his concerns were mostly centered around code maintainability.
But looking deeper into code sample, I discovered something truly frightening.
Take a close look here and see if you can find it:
DLINQ - Simple Select example
// DataContext takes a connection string
DataContext db = new DataContext("c:\\northwind\\northwnd.mdf");
// Get a typed table to run queries
Table<Customer> Customers = db.GetTable<Customer>();
// Query for customers from London
var q =
from c in Customers
where c.City == "London"
select c;
foreach (var cust in q)
Console.WriteLine("id = {0}, City = {1}", cust.CustomerID, cust.City);
DataContext db = new DataContext("c:\\northwind\\northwnd.mdf");
// Get a typed table to run queries
Table<Customer> Customers = db.GetTable<Customer>();
// Query for customers from London
var q =
from c in Customers
where c.City == "London"
select c;
foreach (var cust in q)
Console.WriteLine("id = {0}, City = {1}", cust.CustomerID, cust.City);
My book "Choose Your First Product" is available now.
It gives you 4 easy steps to find and validate a humble product idea.
Haacked on September 28, 2005 23:11 sez:
Ha ha ha! It was almost too fast to have an effect.
nate on September 28, 2005 23:28 sez:
I just spent 5 minutes looking at the code trying to figure out what was so scary about it before i eventually decided to give up and ask.
Turns out the answer is that javascript doesn't run in Thunderbird.
secretGeek on September 28, 2005 23:31 sez:
>javascript doesn't run in Thunderbird
that *is* scary.
Boxy on September 29, 2005 00:23 sez:
I get it... using access as a data context is scary!
Nice... I like your work!
Joel Martinez on September 29, 2005 09:11 sez:
hehe, had the same problem as nate ... reading this in RSS Bandit where javascript is disabled :-)
Had to pull it up in firefox. Funny stuff though :-)
secretGeek on September 29, 2005 16:46 sez:
Damn RSS Bandit and its security features.
Jon Galloway on September 30, 2005 11:14 sez:
Nice. A fine demonstration of Atlas code, no doubt.
I blew it on my code samples. They were decidedly non-scary. I'd wanted to show horribly mangled DLINQ spaghetti code intermingling selects, inserts, updates with c# varible manipulation, but had to get some real work done and left it to the imagination.
Mark Mehelis on October 05, 2005 10:12 sez:
I am one who is not sold on DLINQ.
Code maintainability is a very important thing in my world. This may not be a very good example but in my world my team and I have to maintain 300 plus web pages (yes for one application) now intersperse DLINQ queries in there and you have a nightmare.
So is my ability to use other people to get things worked out. In the SQL world I can walk over to any developer Java, C#, or VB.NET and ask for someone to look at my query and see where I might have an issue. Since the syntax in DLINQ is not consistant between C# and VB.NET. I can't I have this non-standard ( within .NET I am not even talking about the world )way of getting my data.
Then DLINQ is only usable for SQL server so if I am in the Oracle world or my application needs to be able to hook up to a variety of DBs? How do I tune a DLINQ query?
That being said I know what my product is going to be... a DLINQ to SQL translator.
secretGeek on October 05, 2005 16:01 sez:
>In the SQL world I can walk over to any
>developer Java, C#, or VB.NET and ask for
>someone to look at my query and see where
>I might have an issue
true -- this is impossible with Dlinq --
and the gross differences in syntax between VB and C# are an outright mistake. They're putting technical concerns before human ones, which is never the way to go.