Dude! I got quoted! And by none other than Rob Conery of SubSonic fame.

It seems like my last post caused quite an unexpected stir. Thanks to both Rob and Scott for taking the time to answer me. I really appreciate it.

A Word of Appreciation

Let’s get something in perspective. Rob has actually produced something of immense value with SubSonic. I have just complained about it. Rob could very easily have just hammered me down, but he didn’t. Thanks, Rob.

Scott too.

In the last episode of his most excellent podcast, Scott said to his Dad that he likes to stir things up. “Presenting options” was the phrase I think he used. In that case, we are two peas in a pod. I always like to ask questions. If my question uncovers an unjustified assumption, things usually get better. If I’m wrong, then at least I come out knowing why I was wrong and understand the problem better.

While studying for my physics degree, I was asked to give feedback for a course on “Cosmic Dust”. I commented that it was just a completely pointless course. I mean, why waste 12 weeks of lectures studying the invisible dust floating around in space? Instead of numbing our brains with such useless information, we could have been learning something much more relevant. That particular comment, although made privately, really stirred up the lecturer. He got quite mad actually. He even wrote a long letter to the students with his reasoning for why cosmic dust was so important. That itself was unprecedented. No lecturer had ever given us feedback to our feedback before.

Not much changed in the end, but at least I came out of it understanding more about what I’d been doing. Maybe that will happen with ASP.Net MVC.

So thanks to both of you for taking me seriously.

How Dare They!

Last month I watched a documentary about J.K. Rowling. It followed her as she completed and published the 7th and final Harry Potter book. It was the fasting selling book of all time. Truly amazing. But what amazed me most about the whole documentary was a comment made by two girls who had been queuing all night to get their copy of the book:

“Finally! We’ve been waiting 10 years for this!”

The remark was made with a tinge of disgust. It was as if the author had no right to take such a long time writing the book. How dare Mrs Rowling take so much time to finish her book while they had to suffer while sitting around waiting for it. How inconvenient for them! How inconsiderate of Mrs Rowling!

I thought, “if you wanted the book so much, why didn’t you write your own?”

In that spirit, I’m going to try to do something about the ASP.Net MVC thing myself. I don’t want to be that kind of person that complains but does nothing.

Wait! There’s a baby in that bath-water!

I read Rob’s readers’ comments, and I think that it doesn’t require a full rewrite of ASP.Net to do what they want. In fact, I already wrote a bit of code, modeled loosely on Django templates, which allows an ASP.Net developer to control the page output pretty much the same way as MVC promises to do. I’ll have to dig the code out of its hiding place, but then I plan to integrate it with a small Model-View-Presenter framework (a couple of generic base-classes for a Page and Presenter) which will enable a much better way for writing pages than the normal ASP.Net pages do. It also allows full testing of the controlling code.

And better yet, the MVP stuff is based on a refactored and simplified version of some Patterns and Practices code. (Yaaay, we can all be happy together!)

I’ve used this pattern, and each Presenter class is usually a few lines long. My ASP.Net page only contains presentation logic, i.e. stuff to render the page and retrieve input. I don’t need a controller nor a completely new framework to do it. In fact, a Controller class would be much worse, IMHO, because Controllers contain the code for more than one concern - a list page, an edit page, a delete page, etc. (I think that those things could be pragmatically abstracted and made easier anyhow, but that’s another story.) I personally prefer to keep my concerns separate.

And I’m not the only one who likes MVP. Craig Shoemaker does too.

So here’s my plan: I’ll try to publish some ideas and persuade you all to use them. Then I’ll get Microsoft to take Routes, Controllers, and whatever other goodies they’ve got in ASP.Net MVC, and put them in the next full-blown version of ASP.Net. Then everyone can use them and we can carry on with life as normal. I won’t have to use UrlRewriter to do my Routing any more and Microsoft can go back and finish off Workflow Foundation, ASP.Net Ajax, and Patterns and Practices.

Well, that’s the plan, anyway.

(I’ve just got to tidy up some of my code before I publish it. Give me a moment…)