BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Should ASP.NET Developers Learn ASP.NET MVC?

Should ASP.NET Developers Learn ASP.NET MVC?

Leia em Português

This item in japanese

Many discussions of whether or not developers should use or learn ASP.NET MVC has been going on in blogs, Twitter and forums the last couple of weeks. The opinions varies from not recommended to all ASP.NET developers should learn it. InfoQ have tried to summarize some of the recent activity around this topic.

Rob Conerey (Microsoft employee at the ASP.NET MVC team and creator of SubSonic) explains why developers should learn ASP.NET MVC after observing questions raised in the community.

In his introduction he starts off by describing WebForms as “The Great Lie”:

WebForms is a lie. It’s abstraction wrapped in deception covered in lie sauce presented on a plate full of diversion and sleight of hand. Nothing you do with WebForms has anything to do with the web – you let it do the work for you.

This, friends, is a big deal (at least to me): You’re working in a lie. The web is *not* stateful and works with this stuff called HTML sent across wires using another thing called HTTP – you need to know this, love this, and feel it at the bone level.

Rob lists 7 reasons for using ASP.NET MVC or in his own words “7 Reasons To Stop Calling Me A Jerk”:

  1. Testability
  2. Control over HTML
  3. Extensibility
  4. It Makes You Think
  5. …Differently: Javascript Doesn’t Suck
  6. Learning New Concepts
  7. It’s Fun

And concludes with:

Bottom line: I’m having fun web programming again and I think that’s pretty motivating, at least for me and my cats. Yet Another Comparison, sure, but hopefully a bit more direct. You have absolutely no reason at all to not learn MVC – but I will concede there may be a reason or two for you to stick with WebForms.

Joe Brinkman (full time developer on DotNetNuke) quickly followed up with a response, criticizing Rob for not picking “A GOOD Reason To Learn MVC”, and lists his own:

  1. It will expose you to a different architecture
  2. You will be forced to become intimately familiar with HTML and HTTP
  3. MVC promotes unit testing
  4. MVC will make you see how much you take for granted with WebForms

Joe concludes by saying:

So in summary, you really should checkout MVC.  But not for the reasons Rob articulated.  You should explore MVC because in the end you might just learn something that will make you a better web programmer, no matter what platform you choose.

Both Rob and Joe is basically agreeing on the same, that ASP.NET developers should learn themselves ASP.NET MVC, but disagreeing on the why arguments. Karl Seguin however has a different opinion and ask “if ASP.NET is a half-baked solution”:

Being able to write complex systems more cleanly is a good start, but given where web development stands in general, and other platforms specifically, ASP.NET MVC lags far behind (Perl being the only one I can think of which is worse).

There's little question that a big part of the problem is that this is really a VC stack - there is no thought, no support, and no tools for the Model. When you compare the thousands of lines you'll end up writing for your repository/dal/linq/nhiberate to other MVC stacks (which commonly only require that your models to inherit from 1 class), you're already at a serious productivity disadvantage. But the true impact is actually much worse - you lose any cohesiveness of purpose through the controller and views. There is no way to generate HTML labels from model properties, or client side validation.

There is some good news, and that's that a lot of this "infrastructure" is reusable, which makes projects like S#arp Architecture possible. However, I'm still sceptical that these projects can truly succeed against better integrated frameworks.

 Jeremy D. Miller (one of the creators of FubuMVC) lists some pros and cons:

CON:
…the MVC framework is not efficient unless you're willing to roll up your sleeves and build your own project specific infrastructure to fill in the "M", achieve some better testability, easier screen synchronization, and more productive Html helpers…


PRO:
It's pretty easy and straightforward to take the MVC framework by the horns and customize it for your benefit.

Jeremy concludes by saying:

I stand behind the assertion that the ASP.Net MVC framework is a better way in the end to build web apps than an "abstraction wrapped in deception covered in lie sauce presented on a plate full of diversion and sleight of hand,"  but at this point it's probably a tool strictly for early adopter type folks.

Jeffrey Palermo (currently writing the book “ASP.NET MVC in action”) states that “You should NOT use ASP.NET MVC if…”:

  • You are not very comfortable with polymorphism
  • You aren’t willing to build on top of the framework
  • You rely on 3rd party vendor controls for lots of the UI
  • You are averse to using open-source libraries

But continues with:

The ASP.NET MVC Framework is an enabling framework.  It is not a “hold your hand” framework.  It is not a “ASP.NET 101” framework.  You have complete control over everything.  UI patterns in the web space are not so standardized that we can turn over control to frameworks that work in the “standard” way.  Data access has reached this point where we know we need Create, Read, Update, Delete, cascading persistence, lazy loading, etc.  There are many Object-Relational Mappers that support the common operations, and many developers are content giving up complete control over data access because of the similar way leading ORMs work (Hibernate/NHibernate).

There are of course many others that have expressed their opinions, but InfoQ find that the above summarize most of the arguments for and against learning/using ASP.NET MVC.

Rate this Article

Adoption
Style

BT