RDN Express Blog

Blog archive

Points of ViewState

Scott Guthrie wrote a compelling blog this week about the endless nature of technical debates. He then used that context to discuss ASP.NET Web Forms vs. ASP.NET MVC.

The irony: As more and more people weighed in on his blog, it turned into a debate about the merit of Microsoft's classic Web framework versus the relatively new MVC extension.

In Guthrie's view, a developer's problem solving and communication skills often matter more when creating great software than their choice of tools, frameworks and APIs. That may be true, but it sure sounded strange coming from a vice president in Microsoft's developer tools division.

That said, he offered excellent advice on how to approach debates, engage with clients and make use of whatever abstractions feel most natural, while still learning and remaining open to new technologies. The chosen tools and technologies need to meet the requirements of the project, dev team and business scenario.

Web Forms is an interesting dilemma for Microsoft. If change is constant in the technology industry as Guthrie observed, why are so many people still using Web Forms for stateless Web development?

As I reported last week, Scott Hanselman re-issued his "unscientific" 2008 .NET features survey earlier this month and in the 2010 poll, Web Forms was still the most widely used technology, although ASP.NET MVC showed definite traction.

A reader of my blog commented:

"[I] just hope that Microsoft does not use these results to try to justify making a marketing push to promote more use of ASP.NET MVC. This poll should let them know that not everyone is going to switch from using ASP.NET Web forms. I am not! So I hope it will never go away, just get better."

LINQ to SQL has a loyal and vocal following, that appeared to be growing, but Microsoft abruptly announced its support for the Entity Data Model going forward, part of the emerging Entity Framework, which needs lots of work, and requires developers to learn a new paradigm.

ASP.NET MVC also requires learning a new paradigm—no more ViewState or postback--that some developers describe as "complex," and "like reinventing the wheel." The upside is a separation of concerns, source code with an MS-PL license and testability.

Microsoft's Rob Conery, the creator of open source, data access tool SubSonic, is a strong proponent of ASP.NET MVC and the co-author of "Professional ASP.NET MVC 1.0" (Wrox, April 2009) along with Hanselman, Guthrie and Phil Haack.

Conery's "Web Forms is a lie" blog last April got quite a reaction. His opinions haven't changed –- developers should learn MVC even if they don't use it. Conery argues that ASP.NET MVC requires a better understanding of how the Web works, standards and current technologies such as HTML 5. Conery commented on Guthrie's blog this week:

"It comes down to this, really: the Web development landscape is maturing and evolving. HTML/CSS are evolving to do a lot of really wonderful things. It's not a question of 'is this bad' -- it's a question of is this abstraction *needed* and at this point I'd be hard-pressed to come up with a reason for saying 'yes'."

Updates to Web Forms will continue, according to Guthrie. Many people don't realize that Web Forms and MVC share a lot of code, APIs and infrastructure. Web Forms is still the better choice for SharePoint, which doesn't currently support MVC. Guthrie outlined several other scenarios, including this response to Conery's comment:

"In terms of Web Forms specifically - note that a lot of developers using it keep all but their form pages completely stateless (with no or minimal postbacks). What some developers really like about it is that it can provide a nice way to encapsulate UI and functionality - especially for complex form scenarios (inline datagrids, etc.) where they either don't want to write lots of JavaScript (or can't use JS for accessibility reasons or because older browsers need to be supported). Being able to use a datagrid control that helps encapsulate this (as well as browser differences) can make some common scenarios easy and relatively clean. New releases of Web Forms like ASP.NET 4 also now emit pretty clean HTML markup that is easily styled with CSS or customized with client-side JavaScript, and support the URL Routing capabilities first introduced with MVC."

What's your take on developers' allegiance to Web Forms? Is it time to move beyond abstractions and learn Web platforms that demand a firm grasp of HTML/HTTP, standards and today's Web issues? Express your thoughts below or drop me a line at krichards@1105media.com.

Posted by Kathleen Richards on 01/26/2010 at 4:47 PM


Reader Comments:

Wed, Jan 27, 2010 Steve Naidamast New York, USA

I am not quite sure if I understand this debate over which technology may be better or preferred. Technology is used for two reasons by technicians; what they feel comfortable with and what they know will get the job done. There is absolutely no inherent advantage to the use of one of two equivalent technologies. I probably will remain with Web Forms for the rest of my commercial career (I have been in the field 35 years already.) but that does not mean that ASP.NET MVC is not a competent or good choice. Staying with Web Forms is "my" choice and so far it has done the job very well. And for most tasks this is what I need. However, it should also be noted that the use of ASP.NET MVC will most likely be made by technicians who want to try new avenues of development or have very specific requirements for this type of processing model; neither of which are pressing motivations for using MVC. In terms of the requirements, they can be easily changed to be adopted to the standard methodology of web-interface implementation if need be. The result is that the MVC platform, in reality, has no real compelling reason for being used other than preference given that the natural inclination of good developers is to implement a rudimentary form of MVC on their own. In regards to Rob Conery's remarks that developers should use MVC to understand the web better is somewhat of a preference on his part. As professional technicians we shouldn't have to "understand the web better". To do so means that we are applying specific knowledge to the development process that becomes isolated to that process. Thus, it does not become an overall standard and this has been true throughout the entire history of development. Technicians who enjoy tinkering with new technologies often do this to the detriment of their colleagues in the corporate environment, which by its very nature needs some form of median to be productive. The way to understand the "web better" is to provide more transparent technologies where we do not have to get involved in the lower levels of the topology. Developers already have enough on their plate and to add more to it against a technology base that will be constantly changing should be the job of the tools developer and not business technical personnel. We have to be free to be able to accommodate such evolutions against the business environment, not the technically internal ones...

Add Your Comment:

Your Name:(optional)
Your Email:(optional)
Your Location:(optional)
Comment:
Please type the letters/numbers you see above