ASP.NET MVC: Is it worth it?

You talk to God, you're religious. God talks to you, you're psychotic.  - Doris Egan

Catchy title, eh? I’m asking it because I think it’s a legitimate question. I’ve been working with ASP.NET MVC for a couple of reasons:

1) Peer pressure: Developers who I know and respect have been telling me its “very cool” and beats “classic” ASP.NET WebForms by a mile. Some of these people are pretty smart. Some of them are a lot smarter than I am.

2) I have no choice. The current project I’m working on for my “day job” uses ASP.NET MVC along with other “very cool” things like StructureMap, Castle.Validator and a few other alt.net type goodies. (Side note: alt.net may not be so cool. I tried to sign in at their site with my OpenID and it wouldn’t accept it. I got some bullshit about not having a valid email address… Folks, that’s the FIRST TIME I’ve ever been denied an OpenID login!) Correction: a commenter below  correctly stated that I needed to enable my email on my OpenId profile. Usually, what people do is that if your email is not provided, they ask you to enter it. Oh, well….

So anyway,  over the last month or more, I have had no choice but to struggle my way along with two or three other developers who are more or less equally “Into the shark pool: now ‘swim!’”. Today things got so bad that I started pair programming with another guy. You know the concept: One PC, One Driver, One Navigator, and (hopefully) Two Brains. Actually we got a lot done mostly because the other guy was familiar with certain aspects of the framework (its the client’s framework) and I was familiar with other aspects. So in about 3 or 4 hours, I’d say we got about 15 hours worth of what a single developer would be able to accomplish – and most importantly, both of us learned new “stuff” in the process.

But here’s my take on ASP.NET MVC so far:

1) I think it’s very cool. I like the idea of separation of concerns. I like the more "OOP” approach to web development. You can do a lot with it –- but!

2) It has a steep learning curve. ASP.NET MVC is NOT the kind of framework that you want to have to use if you’ve been arbitrarily thrown into a new project where you must use it, especially if you’ve been handed a highly customized codebase from a client that you must use and which cannot be changed for both contractual and architectural reasons.

And – especially – if the project you’ve been handed has a short fuse, for whatever reason.

3) There’s a lot of buzz about avoiding ViewState and the “old” Postback model. I’m just not sure how valid all that stuff is. ViewState is a perfectly OK concept, it’s just that developers don’t understand it and consequently it is prone to abuse. ViewState, additionally, can be stored on the server very easily, so at least a part of this objection is moot.

4) “No Postback model”. OK, that’s fine. But have you looked at what hoops you have to go through to make MVC work? Why do you think they stuck TempData in there into the MVC Framework? And why do you see developers building custom server-side Session for their MVC projects?

5) Complexity: What you get in your View is almost totally dependent on what you do in your Controller. If you need to do “extra stuff”, then you need to write “extra code” in Controller methods. There just isn’t any way around it. Purists will say that’s the way it’s supposed to be (“separation of concerns”). I’m just not so sure I like that – yet.

Bottom Line: The jury is still out for me on MVC. I know there are a lot of purists out there who will call me a traitor. Too bad, guys. I’m not saying I won’t use ASP.NET MVC, I just believe at this point that if I had the luxury of crummy old WebForms I would have been able to produce the same quality app a lot faster, and it’s performance would be the same – or better – than in ASP.NET MVC.   I still think MVC is cool but frankly, I don’t like going home from work with a splitting headache.