ASP.NET MVC – Do I Really Need It?

As a professional software developer, particularly of the Microsoft flavor, you get bombarded with “new stuff”. If you do not instill in yourself a certain discipline, you are sure to be brought down by the sheer complexity of tackling every “new thing” that is sent your way.

I say this from personal experience; I do not mean to be negative in any way in saying this. It’s just a fact of life. There are so many “CTPs” and new technologies being thrown at you that it is easy to succumb to “Beta-itis” – the debilitating compulsion to download and play with every new thing, to the point where your productivity as a software developer begins to suffer.

It’s even worse if you’re an MVP because when you go to the Summit each year, they throw a whole truckful of even more sexy new “Stuff” at you. Sometimes, its stuff that nobody else has seen before and you had to sign an NDA saying you wouldn’t talk or blog about it. Talk about getting excited!

ASP.NET MVC is an example for me. About a year ago, I was working for an IT consultancy and we got a new client who insisted on using their existing codebase which was totally based on ASP.NET MVC. I had to learn not only MVC, but StructureMap (which I really like, thanks to Jeremy Miller) and other cool goodies whose names shall go unexposed for purposes of brevity.

But during this entire exercise, it became obvious to me that I could have done everything they were doing using my perfectly good “Classic ASP.NET” skills. I could have minimized ViewState by keeping it on the server (and I am certainly not the first guy to write about this, here’s a newer one). In addition, in developing a smartphone based web UI for it, it became obvious to us that a lot of the “MVCness” was actually an impediment.

You could make the case for unit – testability, and I would respond that most ASP.NET applications get smoke-tested locally to the satisfaction of the developers before deployment. Don’t get me wrong – I am a big proponent of unit tests and TDD – having helped develop some 700+ unit tests for over 280 DAO’s and Model classes in a current project I am working on.

Purists will tell you that classic ASP.NET doesn’t offer separation of concerns, etc., and they are absolutely right. But classic ASP.NET also works fine, as long as it is understood and not abused by developers.

I’m hip with ASP.NET MVC – MVP buddy Rick Strahl says that his Codepaste.net site (which I think absolutely rocks) was his first venture into ASP.NET MVC. I commend him for it. But the fact is, it could have just as well been coded in classic “ASP.NET” and it would have looked and acted pretty much the same. You want JQuery? You don’t need MVC to use JQuery.

The bottom line is, after a year or more of having been exposed to ASP.NET MVC – and especially seeing various developers putting out their own MVC implementations that do not even rely on the Microsoft engine, because they feel it is flawed – I still remain unconvinced. Read the forum posts and see how much pain the average developer goes through to adopt this -- to do something they already know how to do.

I think the lesson learned for me is to carefully consider new technologies and spend some time objectively determining if they are right for you, rather than “jumping on the latest bandwagon” due to peer pressure. You may decide that you do like a technology, but you want to wait a while before you jump on.

I use LINQ, Entity Framework, LINQ to SQL, lambdas, NHibernate, and much more of the new “stuff” because the benefits are easy to see and I’ve been able to make a determination in my own mind that the learning curve is worth the effort. I'm glad ASP.NET MVC is out there - it's a quality offering. But I’m still not using it. Flame me if you will, I remain unconvinced.

NOTE: Interestingly, Donn Felker, whose work I particularly admire,  has a more recent post that is very similar to this, featuring a real-life example of his own. I hope you’ll read it. Bottom line? Get the job done, get paid, and go home to spend time with your family. Even “Mr. ASP.NET”, Scott Guthrie, has something to say about the controversy. His bottom line? “Respect the choices other people make”.

WebForms isn’t going away anytime soon. As a framework for developing ASP.NET applications, it has evolved into a rich set of tools, controls and features that share more of the same “pieces” with ASP.NET MVC than many developers are aware of.  So if you’re an MVC purist and you feel that WebForms make you feel “dirty”, knock yourself out. You aren’t going to impress me.

Have a happy New Year, do good, and be productive.