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