Getting to grips with LINQ 2.0

Microsoft’s Eric Meijer spoke at QCon about “LINQ 2.0” in his keynote. So what on earth is LINQ 2.0? The name is probably inappropriate; he explained to me later that it is just a convenient tag for “what comes after LINQ 1.0”. Meijer started by talking about integrating relational concepts into languages; he didn’t say exactly what this would look like, but the idea is that you could specify relationships between objects, independent of the objects themselves. This is not LINQ 2.0 though; perhaps it is LINQ 1.1. LINQ 2.0 is about simplifying multi-tier, cross-platform web applications- hence the title of the talk, “Democratizing the cloud.”

So how do we do that? The starting point is that users want the same experience everywhere, irrespective of computer platform or device. Meijer’s idea is programmers should be able to code for the easiest case, which is an application running directly on the client, and be able to transmute it into a cross-platform, multi-tier application with very little change to the code.

That means a cross-platform runtime, right? Sort-of, but Meijer doesn’t envisage having to distribute a runtime engine such as .NET, the JVM (Java Virtual Machine) or Flash. Rather, he wants to use what is already available. Therefore he envisages .NET IL (intermediate language) binaries becoming a universally executable format. The runtime could be the CLR (Common Language Runtime), or the JVM, or the Flash player, or the browser. This would be transparent to the developer, because some intermediate piece would translate the .NET IL to JavaScript, or Java, or  a Flash SWF. or somehing else.

This is a little similar to the concept behind the Google Web Toolkit, which lets you code in Java but translates your code to JavaScript. The idea is that you code in whatever language you like, provided that it compiles to IL. For deployment, some sort of cross-compiler does whatever is needed to run it. Maybe it gets converted to JavaScript, or a SWF, or WPF, or WPF/E; you are not meant to care. He calls this late-binding against the client runtime. Note that this is different from implementing the CLR on multiple platforms, though Microsoft is beginning to do this as well (WPF/E).

So that’s the cross-platform runtime sorted. What about the programming side? How do we make our single-tier VB.NET application into a multi-tier web application?

Meijer talks about growing the application organically using refactoring. His use of the term “refactoring” is wrong I think; refactoring is meant to leave functionality unchanged. He means something more like re-purposing. You would take a method and add an attribute to convert it to a web service. Of course ASP.NET already has this (WebMethod attribute), but Meijer’s idea seems to include greater intelligence about the plumbing behind the exposed method. He believes programmers should only need to think sequentially, even though in reality web applications may have multiple entry-points and users may do things like clicking the Back button.

Meijer applies the same thinking to concurrent programming; developers should be able to do this with simple attributes, rather than struggling with synchronization statements and the like. Similar logic applies to state handling: Meijer reckons programmers should be able to program statefully, and have the infrastructure deal with the problems.

We should give programmers the illusion that their servers are stateful, while we can implement that in some scaleable way. That should be done once instead of all programmers trying to solve that problem.

No roadmap

I chatted to Meijer after his session. He emphasised that there is no roadmap for implementing “LINQ 2.0”; he is merely sharing some research thinking. What I’ve described above may never be implemented, or may evolve into something very different. Some parts sound fanciful to me. Will the idea of compiling IL for different runtimes really fly? Is it feasible to reduce multi-tier programming to a few attributes? Will this be any better than DCOM, which was meant to make distributed objects easy, but proved more complex and less robust than had been hoped?

That said, there’s little doubt that advances in programming will be about introducing new levels of abstraction, which may well provoke scepticism among old-school developers. This has happened before. I respect Meijer for what strikes me as good work in LINQ 1.0, so I’m paying attention.

 

Technorati tags: , ,

Constantine on Usability: should the Office Ribbon be customizable?

Here at QCon, Larry Constantine gave a keynote on usability. His big idea is that developers should not rely on user opinion, feedback and testing to determine the user interface and feature set of applications. You end up with too many features, and replication of past errors. He made some good points, but I was not greatly impressed with this session. The majority of the time was spent poking fun at other people’s UI blunders, which left little space for presenting Constantine’s proposed solution, a thing called Activity Modeling.

First up for scorn was the options dialog in Microsoft Word (pre-2007). This is one of those multi-tabbed affairs with a bewildering number of checkboxes. It’s better in Word 2007; but Constantine is not keen on the famous Office Ribbon either. Let’s say you have an image in a document, he said. Would you really expect Insert Caption to be on the References ribbon?

Possibly not; though looking at the section it is in, I can see the logic of it (it is grouped with “Insert table of figures”). That said, personally I wouldn’t search the ribbon for this. I would right-click the image; and indeed, if you do this, insert caption is right there on the pop-up menu. Constantine either did not spot this, or chose not to mention it.

The underlying point is fair though. No matter how Microsoft designs the ribbon, it will not seem intuitive to everyone. So should the ribbon be customizable? Constantine says it should; he even has a mystery source at Microsoft who told him that it would have been, but the developers ran out of time.

I’m not so sure. Customizability would be nice; yet it is less necessary than in earlier versions, since many more features are exposed by default. The advantage of fixed ribbons is that once you have learned where features are located, they are always there. The snag with highly customizable UIs is that no two instances are the same.

Let’s say you have your customized Word set up just how you like it. Then you have a system crash, or visit another office, and you have to work with Word set back to its defaults. Now where has that pesky icon got to?

In any case, Office is atypical. It’s a mature general-purpose tool, used for everything from quick memos to books and dissertations. By contrast, most business applications (the kind that most developers have to work on) are narrow in focus.

My view is that usability is just difficult to achieve. I don’t think there is any silver bullet, not Constantine’s Activity Modeling, nor Microsoft’s one-way glass, wish line, or any other single technique.

That said, usability does deserve more attention than it tends to get. One good point Constantine made was that the increasing computing power available today gives us more options than were available in the past. Lots of research opportunities here.