Auckland Codecamp

The last codecamp was a huge success :D   We had lots of interesting speakers and I now know a lot more about the WCF service factory than I did before.

My session at codecamp was about Javascript best practices. I think it went pretty well judging by the reactions I got from some of the people in the audience.

I mentioned that I would put up my slides and the demo application

In the afternoon I did not stay at codecamp but instead went with Alex James and Nikhil Kothari to explore Auckland for a while.  During the exploration of Auckland we of course discussed some geeky things like Alex’s pet pieve : Data 2.0 and I could not resist talking about MVC and webforms with Nikhil, after all how often will I get the chance to talk to the architect of webforms face to face.

Anyway I’d like to construct a list of arguments in favor of MVC (eg. Castle/Monorail) and webforms.  So if you’re reading this blog and you have something you can contribute to this list please leave a comment.

So far I have : it’s easier to develop complex UI’s with an MVC type framework than it is with webforms. I’m more productive in the MVC framework than I am with the classic ASP.NET model.  The classic asp.net model promotes code duplication or at least makes it easier to fall into that trap.

 Nikhil has some valid points in defence of webforms:

Sooner or later you are going to need some state that’s why we have viewstate :) and you will typically maintain your own state in a hidden field. Webforms is a framework and you roll your own specific framework for every new site.  There is nothing you can with MVC that you can’t do with webforms. 

All his arguments are valid in my book.

I have to get back to teched now but as soon as I get some more time I’m sending Nikhil a very small project programmed in the MVC way and the same app in webforms.

 

  1. Andrew Goldie

    Your talk at code camp was among the most useful. I am guilty of applying a lot of rigour to my c# coding standards and architecture while (a) avoiding javascript as much as possible (b) when I do have to use javascript hack something that just works. I hope the debate over web forms does hot up here because to me the event model and stateful nature of ASP.NET controls opened up a whole new world, but the trend to improve the user experience through (a return to) AJAX kind of smells funny when combined with “runat=server”. I wonder, too, where technology like Silverlight will lead us?

  2. Alex Henderson

    In my experience, the MVC rails approach lets me:

    * Separation of concerns.
    * Create more beautiful and succinct HTML.
    * Handle alternative logic paths easier via Action overloading.
    * Reuse code between related pages better (because they’re all actions on the same controller).
    * Avoid having to deal directly with untyped query parameters.
    * Avoid having to bind complex forms to nested objects in code by using a single attribute (where as with data binding I’m often left with having to surface deeply nested properties via a custom type descriptor, or to manually assign the properties myself from the control values)
    * Ability to create view components to save repetitive markup but support customization in a more lightweight and flexible manor then controls/user controls.
    * Easier to understand page flow i.e. button that submits to controller a, action b, will display b’s view.. as apposed to the common button click on page a submits to page a where an event then decides to redirect to page b (you don’t know until you check the code). Can be avoided in asp.net though, so probably doesn’t count.. just a common bad practice.
    * You can test both controllers and views independently of each other, TDD friendly.
    * Concise, you write less code – and the model i.e. using Flash & PropertyBag to provide data to the view, makes reuse of controller logic a great deal easier (because it’s not tied to a views implementation).

    ASP.Net Webforms:

    * Has a design-time experience, useful for configuring some complex controls.
    * Allows winforms developers to migrate existing knowledge about data binding, event based programming etc.
    * 3rd party controls.

    That’s enough for now, I have work to do :)

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>