Partager via


LINQ and Simplicity

I've been thinking this week about the impact that LINQ will have on the development world. If LINQ succeeds, it will change the way we think about programming. The team's ambitions for LINQ are large. As the community PM for C#, my job is fairly obvious: I need to help us find a way to make LINQ succeed.

LINQ gives developers a tool built into their native language that allows them to query data. It is perhaps a bit shocking that this has never been done before. Most of the applications C# developers build are designed around databases. Why should our primary language for writing database applications not include a useful mechanism for querying data?

If LINQ succeeds, then it will be impossible for any major language to omit such a tool. For instance, any language that forces developers to embed SQL strings in their source code will be considered hopelessly old fashioned.

If LINQ succeeds, then it will represent a change in the way we build applications that is comparable to the change wrought by the introduction of object oriented programming. Like object oriented programming, however, LINQ requires a major conceptual change in the way developers think about their code. 

As LINQ is rolled out over the next months, we will finally discover whether or not this brave new idea will succeed or fail. If it succeeds -- and it probably will -- it will change the way we think about programming. Nevertheless, we sit perched on the edge of a considerable drama, and it will be exciting to watch it unfold.

Overcoming Complexity

When working with LINQ it is hard not to be seduced by the complexity of its internal implementation. Really smart people who like to think about compilers find LINQ interesting because its implementation is both challenging and relatively unique. The functional programming ideas found in LINQ are not new, but the idea of embedding a functional programming language inside an a mainstream imperative language like C# is relatively unique. The techniques the developers of LINQ used to make this possible are both arcane and fascinating.

The problem, however, is that the people who use C# daily in their work are not interested in esoterica about expression trees, lambdas or extension methods. They have a job to do, and they want to get it done quickly so they can go home and play World of Warcraft.

Most developers are interested in complexity. But their craving is easily sated by the job they face. Most of them don't have either the time or the desire to learn about esoteric compiler details.

As I look ahead over the coming months, it seems to me that my job is fairly obvious. LINQ needs to be presented to developers in a way that makes its utility immediately obvious. The focus has to be on its usefulness, not on the artfulness of its implementation. There is room for the discussion of both issues, but the first task is to show why LINQ is useful, and how easy it is to use.

Comments

  • Anonymous
    January 07, 2007
    Welcome to the XVII Community Convergence. This post is dedicated to Steve Teixeira's Granddad, who died

  • Anonymous
    January 08, 2007
    Hi Charlie: Does that mean your going to provide some LINQ tutorials? I downloaded C# 3.0 (.Net 3.0) and start to play with it. Nice... :-) cheers Lennie

  • Anonymous
    January 08, 2007
    I get boo hoo'd for this idea - but in the same way that SQL created the 'Query Builder' - C# needs a 'LINQ Builder'.   This solves a few issues (1) the complexity, (2) ensuring correct syntax and best of all (3) using a LINQ Builder would quickly teach developers how to right LINQ queries to the point they wouldn't need the builder any longer.

  • Anonymous
    January 08, 2007
    The comment has been removed

  • Anonymous
    January 08, 2007
    Lennie, Yes, we do intend to get some tutorials or basic texts out in the next months. I've been writing some preliminary sketches here: http://blogs.msdn.com/charlie/archive/2006/11/11/charlie-calvert-s-technical-blog-index.aspx And more advanced material, also in preliminary form, is showing up here: http://blogs.msdn.com/wesdyer/default.aspx

  • Charlie
  • Anonymous
    January 27, 2007
    I wonder now LINQ is about querying data in developer language, so are you going to have a simlar stuff for assembly process like monad support finally? I know WF is there but looks still too much coding for me.

  • Anonymous
    April 08, 2007
    In my 30 years of programming I have seldom been so excited by a technology as I am with Linq. I agree that we are on the brink of a evolution in software as we move query into the language. However one must not lose sight of 2 things: 1 - Linq is much more than a ORM tool in fact it will run on top of an ORM as has been done for nHibernate. It will change how we think about programming to any collection or XML. I really find this idea appealing as we apply one progamming model to most data sources. Life becomes so much simpiler.

  1. In the SQL world there will always be cases where we need T-SQL directly such as perfomance and really complicated queries (although in this case I think you need to look at your schema). Linq allows for this as it does not try to provide all the functionality of an ORM and thus their complexity. We are eager to get our hands on the released code as it is frustrating to have to use tools that pale in comparision to Linq. It is great to see that Microsoft is producing a evolutionary technology as they have been accused of being the follower.
  • Anonymous
    October 01, 2007
    I am having a good time with LINQ. I am just worried about reusability on LINQ queries. what do you guys have to tell me about that?

  • Anonymous
    April 03, 2008
    The comment has been removed