This is my brain... This is my brain on LINQ. 2

Posted by jeff Thursday, January 12, 2006 18:32:00 GMT

OWWW does my head hurt after trying to read this new article on MSDN about LINQ.

Ruby on Rails puts my relational model into my object model intuitively. No big philosophical article neeeded.

The languages in the article are staticly-typed languages (I think; I admit after the first half of the article my eyes started to glaze over just a bit). So yes, if you’re using a language like C# to map a relational database model onto an object domain model, LINQ might be one approach.

Like if you’re trying to get to the moon and you’ve never seen a rocket, then yes, I guess you could try using a really really big rubberband.

But trust me, the rocket will work a whole lot better. So if you see someone making a giant rubber band, do them a favor and tell them about the rocket.

Now if you want to get your relational model nicely mapped onto an OO domain model, then Ruby on Rails will work a whole lot better.

So somebody should tell Redmond about dynamic languages and about Rails. Seems to me they’re still trying to make some really big rubber bands over there.

Comments

Leave a response

  1. Horses   January 12, 2006 @ 11:49 PM

    There is dynamic typing in C# 3.0 - here's a much longer LINQ article that's sure to send you to sleep: http://msdn.microsoft.com/netframework/future/linq/default.aspx?pull=/library/en-us/dndotnet/html/linqprojectovw.asp

  2. Brian   January 13, 2006 @ 06:05 AM

    Horses: wow, that is quite the article. Somehow,

    puts "#{customer.name}"
    

    still seems more intuitive to me than

    DataContext context = new DataContext(
         "Initial Catalog=petdb;Integrated Security=sspi");
    Table<Person> custs = context.GetTable<Person>();
    Table<Order> orders   = context.GetTable<Order>();
    var query = from c in custs, o in orders
                where o.Customer == c.Name
                select new { 
                           c.Name, 
                           o.OrderID,
                           o.Amount,
                           c.Age
                }; 
    foreach (var item in query) 
        Console.WriteLine("{0} {1} {2} {3}", 
                          item.Name, item.OrderID, 
                          item.Amount, item.Age);
    
Comment


(won't be published)