Does Web Matrix Have the Razor's Edge?
Perhaps I can blame the Christmas spirit (both ethereal and in liquid form) for the fact that I seem to have unwarily drifted out of the warm and fuzzy confines of p&p, and into the stark and unfamiliar world of our EPX parent. A bit like a rabbit caught in the headlights, I guess. I keep looking round to see what's different from the more familiar world I'm used to, but - rather disconcertingly - it all seems to be much the same. I'm even anticipating somebody telling me what "EPX" actually stands for...
It turns out that the reason I've virtually and temporarily wandered north from Building 5 to some other (as yet unidentified) location on campus is to work on introductory guidance for new-to-the-web developers, based around the new version of Web Matrix. Of course, as I actually work from home here in Ye Olde England I'm not, physically, going anywhere - so the lack of building number precision is not a problem. And some would even say that, at my stage of life, I'm probably not "going anywhere" anyway.
Still, if you are a fan of classic rock music you'll no doubt be familiar with the Australian band AC-DC. I reckon their 1990 comeback album "The Razor's Edge" is their best work, and their greatest public appearance must be the Toronto Rocks concert in 2003. So what about Web Matrix? Coincidently, in the same year as the Toronto Rocks concert, I co-wrote a book called "Beginning Dynamic Websites with ASP.NET Web Matrix". Unfortunately, I can't find any corresponding event from 1990 that I can stretch into an allegory with Web Matrix. But I can confirm that the greatest public appearance for a brand new web development technology, currently code-named "Razor", is its on-stage performance within the latest version of Web Matrix.
OK, so perhaps I need to temper the enthusiasm a little, especially the use of contentious statements such as "brand new". In fact, at first, I rather tended to agree with a comment from someone on a blog discussing Razor when they said "You must be joking - are we going back to 1997?" So what is Razor? Quoting from the Web Matrix site, it is "the new inline syntax for ASP.NET Web pages". Just when I thought that we'd seen the back of inline code in web pages, and that everyone and their dog would be using MVC, MVVP, and other similar patterns - where even code-behind is considered a heinous crime against technology (if not humanity).
And there's more. What about the new Text Template Transformation Toolkit (T4) stuff in Visual Studio 2010? I began my web development career with that wonderful templating technology named IDC (the Internet Database Connector), which was the forerunner to Denali/Active Server Pages 1.0. In those days, we thought that templates and inline code were the height of sophistication, and even went to conferences in T-shirts bearing the slogan <%=life%> to prove that we knew how to get a life.
Of course, the world (and inline coding with VBScript and JScript) changed as Active Server Pages gradually morphed into COM+2 (I still have the set of engraved poker chips), then into ASP+ (I still have the baseball cap), and then - at PDC in Orlando in 2000 - into ASP.NET. And web developers gradually morphed from script kiddies into real developers. We even started to learn proper languages such as Visual Basic and C#.
So it was with some initial trepidation that I started to delve into the wonders of Razor and Web Matrix again. Yes, the version I've been using so far is the beta, but some of the annoying limitations of the IDE and quirks of the syntax are annoying. Yet, within a couple of weeks the team (or, to be more accurate, Christof and I) have completed a draft of the first stage of the guidance, and the beginnings of what will (when complete) be a fairly comprehensive sample application. It's based on one of the Web Matrix templates, and uses jQuery within the UI to provide some snazzy sliding/expanding sections.
What’s clear is that, even though I still tend to gravitate towards the pattern-based approach drilled into me after some years at p&p, Web Matrix and Razor really does make web development easy and quick for beginners. Yes, we were doing sliding and expanding UI stuff with reams of JScript and VBScript in 1997 in the book "Instant Dynamic HTML" for IE4 and Netscape Communicator (still available on Amazon!), and inline code with proper programming languages in 2002 ("Professional ASP.NET 1.0"). And then, of course, with tools such as the original Web Matrix and - later - Visual Web Developer (VWD); all the time moving further and further away from inline code and towards using a wider range of increasingly complex server-side controls.
Maybe it's just a reflection of the fact that, as the complexity of our programming technologies increases, the bar to entry and the steep learning curve may tend to inhibit newcomers to the field. Perhaps this is why PHP (also supported in Web Matrix) continues to be a significant web development technology. In the 90's we worried that inline code (especially script code) was inefficient, and searched for new ways to improve performance. Yet even the fully compiled approach of Visual Studio Web Classes (remember them?) failed to solve the issues. I can remember a web site built using these that required the web server to load a 750KB assembly to generate every page. You were lucky to get a response within 2 minutes some days as the server struggled to shuffle memory around and generate some output for IIS to deliver.
But I suppose that the power and available resources in modern servers means the clever technologies that lie behind Razor can generate pages without even blinking. In fact, I've long been of the opinion that the computer should be able to do all of the really difficult stuff and let us write the minimum code to specify what we want, without having to define every single aspect of how it should do it. Maybe, in terms of web development, Web Matrix is another step down that long and winding road...