Should ASP.NET Developers Learn ASP.NET MVC?
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.
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”:
- Control over HTML
- It Makes You Think
- Learning New Concepts
- 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.
- It will expose you to a different architecture
- You will be forced to become intimately familiar with HTML and HTTP
- MVC promotes unit testing
- 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.
…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…
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.
- 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.
MVC and Windows
Re: MVC and Windows
Uh, all this talk is a bit bizarre to me. Most good developers I know have played with MVC for, uh, at least 10 years? It shouldn't be a question of whether to use it or not, it should be closer to "what MVC or equivalent (like DCI) framework should I use for *this* problem." Color me baffled.
Uhmm... I think you are missing the point that ASP.MVC is an actual MVC framework. (www.asp.net/mvc/)
Re: MVC and Windows