Am I losing out by not using MVC

Published: 10th January 2012
Views: N/A

At this time there are a whole lot of ASP.NET web forms coders out there who confess that they simply don't fully grasp ASP.NET MVC. In a lot of ways, I can relate with them. The expressive fraction that talks about ASP.NET MVC talk about it with such zeal that they make it seem like you'd have to be a idiot not to move over. In actuality, the verdict isn't nearly as easy.

ASP.NET web forms aren't going anyplace. These approaches have their correct place in a web developer's toolbox and it's crucial to identify their benefits and disadvantages. In general, the ASP.NET MVC framework is likely to compromise ease-of-use (e.g. viewstate, validation, etc.) in order to supply developers more restrictive control over the reins. This can be a great thing, but only if you take advantage of it. If not it can just as readily be a problem.

With all of this, I have created a rapid metric to find out if ASP.NET MVC is suitable for you. The way I see it, there are three primary reasons a developer should choose the ASP.NET MVC framework over ASP.NET web forms. If none of these causes are persuasive to you, then you should stick with ASP.NET web forms:

To Obtain Control and Extensibility

As indicated out in the remarks, ASP.NET MVC provides you a lot more control and extensibility options than ASP.NET web forms. You get complete management over the page request lifecycle and the ability to replace out several key pieces of the framework (e.g. view engine, routing, etc.), none of which is feasible with ASP.NET web forms.

In addition to this, you also achieve full control over the delivered HTML. In general, the rendered HTML from ASP.NET web forms applications is terrible. The web controls it utilizes crank out waste ids and hidden fields in abundance that not only impede the performance of a site, but also make CSS style and Javascript development a pain. ASP.NET MVC makes you to be more in tune with your HTML. There aren't any datagrids or repeaters that like magic create markup for you. There aren't any disguised . fields to continue to persist state for you. It's just you, the HTML, and a number of extension procedures.

To Unit Test

This, in my opinion, is the most engaging reason to use ASP.NET MVC. When it comes to unit testing, ASP.NET MVC basically beats ASP.NET web forms. It's not even close. Whereas ASP.NET web forms requires you to jump through all forms of hoops to test around the web page event lifecycle, the ASP.NET MVC framework basically begs to be tested. There are interfaces almost everywhere proclaiming "mock me up!".

There's a good reason why the most significant ASP.NET MVC proponents also usually tend to be TDD proponents; it's because ASP.NET MVC in fact permits for TDD. In my opinion, I believe this is where all the enthusiasm comes from. Simply put: it's genuinely hard to do TDD with ASP.NET web forms and truly uncomplicated to do it in ASP.NET MVC.

To Look at Something New

I should discuss that mastering ASP.NET MVC is an incredibly engaging process since the ASP.NET MVC framework staff has been so interactive in the process. I consider a huge part of the charm of ASP.NET MVC is that the community's suggestions is not only being taken into consideration, it is actively being sought after. The framework has started so many posts and debates over best practices that just following along introduces you to ideas you might recently have been ignorant of. I would really propose figuring out the ASP.NET MVC framework for this factor alone.

So there it is. Aside from those three, I can't think of any other reasons why a programmer would learn about ASP.NET MVC. Possibly this is why the adoption rate isn't nearly as high as we consider it should be. The motivation for using the framework essentially boils down to unit testing, control/extensibility, and feeling of boredom/interest. Fine reasons, but hardly game breakers for the vast bulk of developers out there.

Report this article Ask About This Article

More to Explore