Microsoft PDC Day 2

A big part of day 2 was an introduction to Windows 7, the successor to Windows Vista. Not surprisingly, there’s been plenty of coverage on this topic so I’m not going to discuss the announcements in any great detail (you can also watch the complete keynote). However, let me quickly mention a couple of things that made an impression on me:

The other exciting part of the day was getting to talk with Phil Haack from the ASP.NET team. I wanted to ask Phil about his ASP.NET MVC presentation. If you read my post from day 1 you’ll note that I had some concerns about the use of some pretty ugly C# code in the view layer of the framework. I asked Phil what sort of plans they had for enabling developers to create codeless views. He was quick to point out that there’s no rule stating that you can’t have code in your views — I completely agree with that (after all, what is a JSP tag library but a fancy wrapper on some Java code) but from a readability and aesthetic perspective it still seems wrong to have raw C# code in your view.

Phil did seem to agree that the aesthetics of inline C# code in the ASPX left something to be desired (hope I’m not putting any words in your mouth here Phil) and said that they were looking at creating some declarative wrappers around the HtmlHelper class. Turns out that these “declarative wrappers” are really nothing more than good ol’ ASP.NET server controls. The one thing that I didn’t really grok until I talked with Phil was that WebForms server controls will work in the MVC environment . . . as long as they aren’t dependent on any WebForm-specific concepts like ViewState or the page lifecycle.

Turns out that I’ve done some server control development so I might just take a crack at creating some of my own wrappers just to see how it works. Stay tuned for more on this.

The other thing to point out is that you aren’t limited to using ASPX pages as your view engine — since all of this stuff is loosely coupled you’re free to plug in whatever engine you like. At the moment, there are a handful of alternative engines available including Brail, NHaml, and NVelocity.

Thanks to Phil for taking the time to talk with me — much appreciated.

October 29, 2008 • Posted in: programming

One Response to “Microsoft PDC Day 2”

  1. Haacked - October 31st, 2008

    No problem, it was a good discussion. :) The other approach to cleaning up the views I neglected to mention is to get dynamic languages such as IronRuby working in the views. It’s still code in the view, but for many people, it’s more “aesthetic” code. ;)

Leave a Reply