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);
'Haacked' on Thu, 29 Sep 2005 03:11:41 GMT, sez: Ha ha ha! It was almost too fast to have an effect.
'nate' on Thu, 29 Sep 2005 03:28:43 GMT, 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 Thu, 29 Sep 2005 03:31:46 GMT, sez: >javascript doesn't run in Thunderbird
that *is* scary.
'Boxy' on Thu, 29 Sep 2005 04:23:26 GMT, sez: I get it... using access as a data context is scary!
Nice... I like your work!
'Joel Martinez' on Thu, 29 Sep 2005 13:11:21 GMT, 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 Thu, 29 Sep 2005 20:46:05 GMT, sez: Damn RSS Bandit and its security features.
'Jon Galloway' on Fri, 30 Sep 2005 15:14:21 GMT, 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 Wed, 05 Oct 2005 14:12:07 GMT, 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 Wed, 05 Oct 2005 20:01:57 GMT, 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.
|