1. Welcome Guest! In order to create a new topic or reply to an existing one, you must register first. It is easy and free. Click here to sign up now!.
    Dismiss Notice

Surprised by LINQ

Discussion in 'Microsoft News' started by NewsBot, Mar 31, 2008.

  1. NewsBot

    NewsBot I Got News

    Joined:
    Feb 8, 2006
    Messages:
    1,813
    Operating System:
    Windows Vista Home Premium
    I have to say that before I got my hands on VS 2008 and really sat down to write serious code, I wasn't that excited about LINQ. I thought the DB access would be great for small or one-off apps and the XML stuff was nothing new. Some of the LINQ to objects stuff looked alright but I*still wasn't that impressed.

    Now that I've spent some time with it, I love it. The amount of operations that we do that can be expressed as set operations (projection via Select(), filtering via Where(), grouping, etc.) is nuts. I can rewrite entire methods as one-liners that just use query clauses properly. I'm writing a World of Warcraft combat log parser at home and so far it's basically 2 lines: create a RegEx, run a query that parses the file into an object graph.

    Extension methods are quite nice as well. I can write Converter classes that move between our internal representations, for example Entry, to an external proxy object, Post, for returning from Web Services. The beauty is that Entry and Post have no idea about each other but I can still write thisEntry.ToPost(). I get awesome separation of objects and great syntax.

    Anyone else out there having a good (or bad) time with LINQ?



     

Share This Page