About Technical Debates (and ASP.NET Web Forms and ASP.NET MVC debates in particular)

[In addition to blogging, I am also now using Twitter for quick updates and to share links. Follow me at: twitter.com/scottgu]

Technical debates are discussed endlessly within the blog-o-sphere/twitter-verse, and they range across every developer community. Each language, framework, tool, and platform inevitably has at least a few going on at any particular point in time.

Below are a few observations I’ve made over the years about technical debates in general, as well as some comments about some of the recent discussions I’ve seen recently about the topic of ASP.NET Web Forms and ASP.NET MVC in particular.

General Observations About Technical Debates

Below are a few general observations independent of any specific technical debate:

a) Developers love to passionately debate and compare languages, frameworks, APIs, and tools.  This is true in every programming community (.NET, Java, PHP, C++, Ruby, Python, etc).  I think you can view these types of religious technical debates in two ways:

  1. They are sometimes annoying and often a waste of time.
  2. They are often a sign of a healthy and active community (since passion means people care deeply on both sides of a debate, and is far better than apathy).

Personally I think both points are true.

b) There is never only “one right way” to develop something. As an opening interview question I sometimes ask people to sort an array of numbers in the most efficient way they can.  Most people don’t do well with it.  This is usually not because they don’t know sort algorithms, but rather because they never think to ask the scenarios and requirements behind it – which is critical to understanding the most efficient way to do it.  How big is the sequence of numbers? How random is the typical number sequence (is it sometimes already mostly sorted, how big is the spread of numbers, are the numbers all unique, do duplicates cluster together)? How parallel is the computer architecture?  Can you allocate memory as part of the sort or must it be constant?  Etc. These are important questions to ask because the most efficient and optimal way to sort an array of numbers depends on understanding the answers. 

Whenever people assert that there is only “one right way” to a programming problem they are almost always assuming a fixed set of requirements/scenarios/inputs – which is rarely optimal for every scenario or every developer.  And to state the obvious - most problems in programming are far more complex than sorting an array of numbers.

c) Great developers using bad tools/frameworks can make great apps. Bad developers using great tools/frameworks can make bad apps. Be very careful about making broad assumptions (good or bad) about the quality of the app you are building based on the tools/frameworks used.

d) Developers (good and bad) can grow stronger by stretching themselves and learning new ideas and approaches.  Even if they ultimately don’t use something new directly, the act of learning it can sharpen them in positive ways.

e) Change is constant in the technology industry.  Change can be scary.  Whether you get overwhelmed by change, though, ultimately comes down to whether you let yourself be overwhelmed.  Don’t stress about having to stop and suddenly learn a bunch of new things - rarely do you have to. The best approach to avoid being overwhelmed is to be pragmatic, stay reasonably informed about a broad set of things at a high-level (not just technologies and tools but also methodologies), and have the confidence to know that if it is important to learn a new technology, then your existing development skills will mostly transition and help.  Syntax and APIs are rarely the most important thing anyway when it comes to development – problem solving, customer empathy/engagement, and the ability to stay focused and disciplined on a project are much more valuable.

f) Some guidance I occasionally give people on my team when working and communicating with others:

  1. You will rarely win a debate with someone by telling them that they are stupid - no matter how well intentioned or eloquent your explanation of their IQ problems might be.
  2. There will always be someone somewhere in the world who is smarter than you - don’t always assume that they aren’t in the room with you.
  3. People you interact with too often forget the praise you give them, and too often remember a past insult -  so be judicious in handing them out as they come back to haunt you later. 
  4. People can and do change their minds - be open to being persuaded in a debate, and neither gloat nor hold it against someone else if they also change their minds.

g) I always find it somewhat ironic when I hear people complain about programming abstractions not being good.  Especially when these complaints are published via blogs – whose content is displayed using HTML, is styled with CSS, made interactive with JavaScript, transported over the wire using HTTP, and implemented on the server with apps written in higher-level languages, using object oriented garbage collected frameworks, running on top of either interpreted or JIT-compiled byte code runtimes, and which ultimately store the blog content and comments in relational databases ultimately accessed via SQL query strings.  All of this running within a VM on a hosted server – with the OS within the VM partitioning memory across kernel and user mode process boundaries, scheduling work using threads, raising device events using signals, and using an abstract storage API fo disk persistence.  It is worth keeping all of that in mind the next time you are reading a “ORM vs Stored Procedures” or “server controls – good/bad?” post.  The more interesting debates are about what the best abstractions are for a particular problem.

h) The history of programming debates is one long infinite loop – with most programming ideas having been solved multiple times before.  And for what it’s worth – many of the problems we debate today were long ago solved with LISP and Smalltalk.  Ironically, despite pioneering a number of things quite elegantly, these two languages tend not be used much anymore. Go figure.

Some Comments Specific to ASP.NET Web Forms / ASP.NET MVC debates:

Below are a few comments specific to some of the recent debates that I’ve seen going around within the community as to whether a ASP.NET Web Forms or ASP.NET MVC based approach is best:

a) Web Forms and MVC are two approaches for building ASP.NET apps. They are both good choices. Each can be the “best choice” for a particular solution depending on the requirements of the application and the background of the team members involved. You can build great apps with either.  You can build bad apps with either. You are not a good or bad developer depending on what you choose. You can be absolutely great or worthless using both.

b) The ASP.NET and Visual Studio teams are investing heavily in both Web Forms and MVC.  Neither is going away.  Both have major releases coming in the months ahead.  ASP.NET 4 includes major updates to Web Forms (clean ClientIDs and CSS based markup output, smaller ViewState, URL Routing, new data and charting controls, new dynamic data features, new SEO APIs, new VS designer and project improvements, etc, etc).  ASP.NET 4 will also ship with ASP.NET MVC 2 which also includes major updates (strongly typed helpers, model validation, areas, better scaffolding, Async support, more helper APIs, etc, etc).  Don’t angst about either being a dead-end or something you have to change to.  I suspect that long after we are all dead and gone there will be servers somewhere on the Internet still running both ASP.NET Web Forms and ASP.NET MVC based apps.

c) Web Forms and MVC share far more code/infrastructure/APIs than anyone on either side of any debate about them ever mentions - Authentication, Authorization, Membership, Roles, URL Routing, Caching, Session State, Profiles, Configuration, Compilation, .aspx pages, .master files, .ascx files, Global.asax, Request/Response/Cookie APIs, Health Monitoring, Process Model, Tracing, Deployment, AJAX, etc, etc, etc.  All of that common stuff you learn is equally valid regardless of how you construct your UI.  Going forward we’ll continue to invest heavily in building core ASP.NET features that work for both Web Forms and MVC (like the URL Routing, Deployment, Output Caching, and DataAnnotations for Validation features we are adding with ASP.NET 4). 

d) I often find debates around programming model appropriateness and abstractions a little silly. Both Web Forms and MVC are programming web framework abstractions, built on top of a broader framework abstraction, programmed with higher level programming languages, running on top of a execution engine abstraction that itself is running on top of a giant abstraction called an OS.  What you are creating with each is HTML/CSS/JavaScript (all abstractions persisted as text, transmitted over HTTP – another higher level protocol abstraction). 

The interesting question to debate is not whether abstractions are good or not – but rather which abstractions feels most natural to you, and which map best to the requirements/scenarios/developers of your project.

e) We are about to do a pretty major update to the www.asp.net site.  As part of that we will be posting more end to end tutorials/content (for both Web Forms and MVC).  We will also be providing tutorials and guidance that will help developers quickly evaluate both the Web Forms and MVC approach, easily learn the basics about how both work, and quickly determine which one feels best for them to use. This will make it easy for developers new to ASP.NET, as well as developers who already know either Web Forms or MVC, to understand and evaluate the two approaches and decide which they want to use.

f) Decide on a project about whether you want to use Web Forms or MVC and feel good about it.  Both can be good choices.  Respect the choices other people make – the choice they have made is also hopefully a good one that works well for them.  Keep in mind that in all likelihood they know a lot more about their own business/skills than you do.  Likewise you hopefully know a lot more about your own business/skills than they do.

g) Share ideas and best practices with others.  That is a big part of what blogs, forums, listservs and community is all about.  What makes them work great is when people know that their ideas aren’t going to be ripped to shreds, and that they will be treated with respect.  Be constructive, not snarky. Teach, don’t lecture. Remember there is always someone else out there who you can also learn from.

Hope this helps,

Scott

106 Comments

  • Scott,
    As per usual, very well put. A big thankyou to you and your team for the great work you put into continuing the development of these frameworks. Invariably these platforms speed up our development and keep us competitive. These frameworks are essentially *abstracted*(pun intended) R&D for our development teams.

    Thanks Again!

  • 010101110110010101101100011011000010000001100100
    01101111011011100110010100100001

  • Well said, Scott. Argueing about tools and technology is just a waste of air. I help to run a community related to astronomy, with both developers and end users. When the developers get going, it can be a real turn-off for the users.

  • Great post - Wise and neutral sort of response... feels like it was written by Yoda himself... but about .NET technologies...

  • Interesting thoughts and results, thx Scott

  • You can pretty much just read this line - sums it up perfectly -

    "The interesting question to debate is not whether abstractions are good or not – but rather which abstractions feels most natural to you, and which map best to the requirements/scenarios/developers of your project."

    Nice work :)
    ChrisNTR

  • Wow... i feel like i've been listening to my grandpa by the fire share his wordly knowledge with me.... haha

    You teach programmer equality too well. I spose this is why you are such as jedi in this industry.

    all great stuff as usual.

  • Thanks for stepping up and writing this, I know it makes sense for you to do so, but hopefully the zealots will actually take it to heart!

  • Scott,

    Excellent post. Specially the preamble.
    Could you share with us in what situation you choose the webforms x mvc approach?

    Camilo

  • Great post. MVC has become a buzz word, which every manager wants in their solution. No one sees that it is just a pattern just like web forms is, both running on the same underlying technology. Thanks for putting it out there.

  • "The best approach to avoid being overwhelmed is to be pragmatic, stay reasonably informed about a broad set of things at a high-level (not just technologies and tools but also methodologies), and have the confidence to know that if it is important to learn a new technology, then your existing development skills will mostly transition and help. Syntax and APIs are rarely the most important thing anyway when it comes to development – problem solving, customer empathy/engagement, and the ability to stay focused and disciplined on a project are much more valuable."
    That's the way to improve yourself. It's what i recommend when i talk with my collaborators.

    Thanks for this post.

  • but without debate, new tech will not come out, and we do not know what we want and what we do no need.

  • Thanks for blogging on this. A lot of us have had very good careers because we have followed your "advice". Most of us "discovered" you with ASP.NET. Later you told us about AJAX, and Linq ect. all have worked out well for anyone following your advice.

    When you started talking about MVC (a lot) many of us were left wondering "Is that where I should go?". It is important that you let us know it is ok to still use Web Forms.

    The desire is not not start doubting the "Man in the Red Shirt" after following his advice for so long has worked out so well.

    Now if you would only offer an opinion on the MVVM debate... :)

  • @jack.niu,

    >>>>>>>> but without debate, new tech will not come out, and we do not know what we want and what we do no need.

    Just to make sure I'm clear - I think debate is good and healthy. I'm definitely not arguing against debates.  

    I do think some ways are better to debate than others though - be respectful, be open minded, focus on the positives of your opinion/approach and what it brings, don't make it personal with others.  Having good healthy debates like this on which scenarios and for what teams Web Forms or MVC is best applied is not bad at all.

    Hope this helps,

    Scott

  • Re: "General Observations" -- a very good, and very mature list. Wished they were practiced more.

  • I think your article is great on a couple of levels.

    1) you talk about debates in the community and how they are a fact of life and a good way to gauge the maturity in people that exist in this community.
    2) specific improvements coming with both technolgies which is important to understand from an Enterprise perspective.
    3) We live in a diverse world. You can either embrace this diversity and use it to your advantage or run from it.
    4) That a developers skills are not just measured on how well they know a specific API or syntax. That it is more important to focus on the problem solving, disciplne and customer empathy.

    Well written.

  • @steve,

    >>>>>>> Re: "General Observations" -- a very good, and very mature list. Wished they were practiced more.

    And just in case I come across all saintly - I unfortunately do violate some of the "communication guidance" suggestions I listed above more often then I'd like. I'm definitely still working on always practicing those myself! :-)

    Scott

  • Scott,

    Your wisdom and expertise in speaking/spreading that wisdom is why so many developers look up to you. This posting is pure GOLD. The arguments that I get involved in over language, framework, methodologies, syntax, etc.. all seem very much impractical and useless when put under the light this post has shed. Thank you for the continued effort into making our lives as developers easier, and ultimately better.


    Thank you.

  • Well said! I often tell the same thing to my team. It's not always about the technology, it's about developers attitude towards them.

    Cheers,
    Ludmal

  • MVC is not a buzz word.. it has been their since smalltalk and it is better than web forms. ASP.NET MVC and Webforms and are not apples and oranges .. they're apples and apples and one way is better than the other and saying other wise is just wishy washy BS.

  • >>>The interesting question to debate is not whether abstractions are good or not – but rather which abstractions feels most natural to you, and which map best to the requirements/scenarios/developers of your project.<<<

    Ack. I guess I'll put my neck on the line and be the first to perhaps swim a little upstream... I don't know if the issue is whether the WebForms abstraction is *good* or not (though many people will couch it that way) - I think it's whether the abstraction is needed anymore, much less warranted.

    I'm not an Alt.netter - but I've come to very much appreciate what MVC brings to the table and I've embraced it not just as an "alternative" but as a generational thing - a "maturing" if you will that nudges the developer, ever so gently, to think about testing. Nudges by asking if they want a testing project, nudges by making it easy with a higher level of decoupling and abstration where necessary. Nudges by embracing HTTP/HTML which is the medium in which we work. Nudges by allowing people to think in terms of "what goes where" aside from "what can my IDE do for me today" - which is all fine but it doesn't drive the web development industry forward really and puts the MS developer in a really weird position in terms of how they are regarded in the industry as general.

    Your points RE abstraction are valid. However, to me, the argument is really just bit off base - it's what things are abstracted into what. When you abstract a webpage into a stateful form experience it's like abstracting spinach and broccoli into mac and cheese for your kids (something that you'll come to know quickly...) - it *can work* in theory, but in practice it takes some extra time and patience and your results may vary. Some kids might really dig it - others might not take to it so well (and no I don't mean to be condescending but I have kids so this is my life and all I know right now).

    Bottom line: MS web developers are the only ones who think of the web in terms of "stateful forms" with very little knowledge of how the sausage is made :). This puts them at a bit of a disadvantage in their career - they (for the most part) don't need to worry about the core issues of the industry (what HTML 5 means, compression issues, standards compliance, semantic issues, etc).

    I agree with you on debates - they can be tiring and yes they are necessary. But I think you can understand how your creation has inspired so many people because it does so much more for them. It allows for so much flexibility and the "doing of the right thing" in terms of the future. Which is a tough statement to make in this industry - but people who have been at this for a very long time adore you for creating the MVC framework - we're just having a really hard time right now sharing that because the Codebetter guys like to write rants with swear words which makes this all look like a frat party.

    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".

    All that said - it's great to see you weigh in on this stuff - I'd agree with you that it's getting out of control :).

  • Item G of your general observations is just brilliant. One of my new favorite quotes!

    Great topic.

  • Thanks for posting this, Scott.

  • @robconery,

    As I posted my comment to this blog, I saw yours post. After reading your comments, I wanted to respond with this. I don't believe that implementing the MVC pattern over the page controller pattern currently used in the Asp.net model is necessarily an evolution in the web development landscape. MVC is a pretty old pattern in general and even for the web was implemented in java years ago via Struts. What I do find interesting is that even though Struts have been available for years, Java now more recently supports this stateful form in the form of Java Server Faces.

    I think that the what is a good sign of maturing or evolving is that developers understand both approaches so that they can speak intelligently on the subject and decide which technique is better for the problem at hand.

    As for whether an abstraction is needed anymore, I would have to say yes. I can implement other patterns that do not need a front controller using Asp.net where this might be an issue with the way MVC is designed. Not that either one is better or worse, just trying to point out that the default behavior of one may preclude me from solving the problem the best way.

    At any rate thanks for the post, because it gave me another view point to consider.

  • Which framework have you guys chosen to re-develop www.asp.net?

  • @Bryan,

    >>>>>>>> Which framework have you guys chosen to re-develop www.asp.net?

    For the www.asp.net web-site we've decided to use Umbraco (http://umbraco.org/) - which is a great ASP.NET open-source CMS system.

    Hope this helps,

    Scott

  • @Bill Woodson think evolution in terms of compliance and testing :). If you use a "Page Controller" pattern with webforms I applaud you :) but I invite you to find out a bit more about what MVC can and cannot do before deciding (respectfully). One of the hallmarks of ASP.NET MVC is the extensibility which is a credit to Scott and team - I think you'll be happy with what's possible.

    Which is why I like to suggest people *learn* it (not necessarily adopt it) before assessing whether it's for them.

  • "Each can be the 'best choice' for a particular solution depending on the requirements of the application and the background of the team members involved"

    Without taking team knowledge, what are some examples where WebForms is a "best choice"? What are some examples where "MVC" is a best choice? Or is team knowledge the only significant factor?

    If webforms is sometimes a "best choice" would that imply that writing such sites in a pure-MVC framework like Rails or Django be a mistake? Why have no other frameworks, languages or communities emulated WebForms?

  • Firstly: Brilliant post Scott. This should be compulsory reading for any developer or technical expert.

    Secondly, Rob Conery wrote:
    >>>Bottom line: MS web developers are the only ones who think of the web in terms of "stateful forms" with very little knowledge of how the sausage is made :). This puts them at a bit of a disadvantage in their career - they (for the most part) don't need to worry about the core issues of the industry (what HTML 5 means, compression issues, standards compliance, semantic issues, etc).<<<

    And I say:
    Amen! Amen brother. It's so great to hear someone speak up on this. I say this having just spent the last few weeks unravelling an unholy mess of a WebForms app in order to defuse multiple redundant postbacks, massive pageweights (1.4MB with 120 resources), and some horrific misinterpretations of the page lifecycle. The devs asked why it was performing badly and chewing up CPU.

    And this from some "good" developers. Developers who really know their stuff when it comes to C#.

    And we wonder why so many "real" web designers and HTML/CSS coders so readily dismiss ASP as a platform.

  • >>For the www.asp.net web-site we've decided to use Umbraco (http://umbraco.org/) - which is a great ASP.NET open-source CMS system.

    fantastic, been using umbraco for more than a year now, great choice.

  • Hi,

    I am using MVC 1.0 i need to do modfications in the login registration.
    Example : If any new user registered it has to be approve / reject option by Adminstrator / Moderator.

    If user is approved then only he can able to login.

    Kindly suggest some tips / observations.

  • @robconery,

    Sorry I must have been unclear, Asp.net implements the concepts of the page controller pattern by default. Also by your comment I must have lead you to believe I am unfamiliar with the MVC pattern or Microsoft's implementation of it. I have used Asp.net MVC since the v 1.0 release.

    My only point was to address your comment originally posted "I think it's whether the abstraction is needed anymore, much less warranted", and simply put there are appropriate uses for both.

    As for compliance and testing, I am not sure what you mean by compliance, but as far as testing, I am able to test just as much logic in the standard asp.net code as I am with my MVC code. The framework does not preclude good testing but rather it is the patterns you implement.

  • "c) Great developers using bad tools/frameworks can make great apps. Bad developers using great tools/frameworks can make bad apps. Be very careful about making broad assumptions (good or bad) about the quality of the app you are building based on the tools/frameworks used."

    This seems like a argument saying that everything the Visual Studio team does is completely pointless? As a developer I adore the amount of perfection the teams around the .NET technology puts into perfecting the development tools, which is a much higher standard than the rest of the industry.

    Frameworks, APIs, handy code syntax (thank you for 'yield' in C#!), and development tools allows us to focus on what we actually want to create, rather than having to focus on the actual building process.

    If we were to completely ignore tools and APIs, we would all be coding our websites in Rails, on Linux, in Emacs.

    The main reason for me to even bother developing in ASP.NET is the reasons you say aren't the main focus in this post. Which is confusing, so to say.

  • @Karl

    Look what you started. I should have known when I saw that topic "The WebForms Rant" I should have hit the back button. Your blog post was pretty much a slap in the face to Scott and his team since they were the original creators of ASP.NET. I don't mind the criticism; but your language and tone completely turned me off and I'm sure other as well. You even manage to tick off "The Gu", which I thought wasn't possible.

  • +1 for what Karl said: when exactly is Web Forms the better choice, other than when you have a team that isn't "ready" to switch to MVC? I'm a Web Forms man with no experience of MVC but even I can't imagine using Web Forms again after my current project.

  • Ok, Scott, let's hear it straight from you. You prefer MVC for everything don't you? Don't you? Come on! Say it! Say it! .... There! Doesn't it feel better? :)
    --------
    Thanks for a lovely reflection. Great call to professionalism, I'd say.

  • The funnest debate ever (and probably still is) was Java versus .NET. I think the best programming framework is the one that gives you what you need in the shortest time possible, is the most fun and provides quality, reliable execution in production. So yeah, that's going to be different depending on who you ask right?

    Interesting fact: Scott Hanselman recently did a follow up survey about .NET Frameworks and it looks like MVC is catching up to Web Forms. Of course he said the margin of error is +/-101% :) http://www.hanselman.com/blog/2010SurveyResultsWhatNETFrameworkFeaturesDoYouUse.aspx

    P.S. LISP rocks (not having a lisp, but the programming language)!

  • @robconery,

    As you know I also appreciate what ASP.NET MVC brings to the table as well :-) And for what its worth - I'm part way through a pretty in-depth blog series about ASP.NET MVC 2, which is hopefully a sign that I think people should learn more about it!

    re: abstractions

    One observation I'd make with debates around abstractions is that the abstraction a person knows well always feels "natural" and other abstractions typically feel "unnatural". That is normal. I was in a debate with a PHP developer a few weeks ago who was critiquing the MVC pattern in general as too "magic" of an abstraction. You and I might think it obvious that a MVC approach where a URL maps to a method on a class, which then uses an ORM to retrieve objects that represent rows in a database, and then pass it off to a separate view template to render is "clean", "natural" and "close to the metal". His argument was that was all unnecessary complex and very removed from what really happens on a web-server. His argument was why not just have a single page with a block at the top of it that writes inline SQL to retrieve a list of rows - and then do a for loop inside the HTML to display them? His argument was that approach was much less magic and a more straight forward abstraction (and consequently more powerful and easier).

    My point is certainly not that what he was arguing was correct - rather that it was an interesting perspective and different than the typical ones between MVC and WebForms (where both camps naturally assume they are better than inline code).

    While I can't ever imagine myself wanting to write a web app again that uses raw SQL strings and datarow objects for data-access, I can see how one could technically also argue that by using an ORM with an object based query syntax (like LINQ or equivalents on other platforms) and which employees lazy-loading across relations I can find myself "with very little knowledge of how the sausage is made" and disadvantaged in terms of knowing what is really going on with my data access (and how to really optimize things). My meta-point is that we need to be cognizant that abstractions are common everywhere when we program - and that many an abstraction is good (thank god for garbage collection, ORMs, AJAX frameworks - 3 abstractions that almost every web framework takes for granted now but which only became popularly used the last decade or so).

    re: Web Forms

    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 needs 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.

    Is web forms for everyone? No - that is why we created MVC as an alternative option. But a web forms base approach is one that a lot of people know and still like today. Ironically JSF (Java Server Faces) - which is kind of a Web Forms clone in the Java world and which I had assumed was long dead years ago - is still apparently alive. I just looked at some jobs technology report and apparently there are still more active *new* job postings that mention JSF in them than Rails or Django. Weird but true. FWIW there are still more *new* job posting that mention "web forms" in them than JSF, Rails and Django job posts combined.

    re: My Meta Point of this Post

    My aim with this post isn't to try and defend either Web Forms or MVC. If I could sum it up I would say:

    1) Be civil and open in debates with others - regardless of whether those debates are technical, religious and political! Learn new things and grow. Don't be afraid. Don't be too quick to judge.

    2) Learn enough about Web Forms and MVC to make an informed decision about what best works for you. If you really like MVC great - definitely use it. If MVC doesn't float your boat, or you think you have too much code, skills or knowledge already invested to move to it anytime soon then don't feel like you absolutely have to. Web Forms is mature, continuing to be improved, and isn't going anywhere.

    Hope this helps,

    Scott

  • @Karl,

    >>>>>>>>>> Without taking team knowledge, what are some examples where WebForms is a "best choice"? What are some examples where "MVC" is a best choice? Or is team knowledge the only significant factor?

    Existing team knowledge, comfort, and code base is a big factor. A lot of projects begin by extending others.

    In terms of specific reasons to consider Web Forms for new projects:

    1) If you are using SharePoint. Today SharePoint sites more naturally integrate Web Forms web-parts/pages in them. The SharePoint team would like to add MVC support in the future - but if your site/solution integrates with SharePoint today or the new version coming out you'll find Web Forms easier to-do this.

    2) If you are building an application where an existing server control or set of server controls can help provide a lot of functionality. This is true for a lot of reporting scenarios (where you can leverage charting controls) as well as data editing scenarios involving grids (where you can leverage data controls). There are also a rich set of server-side controls that have AJAX functionality encapsulated within them that a lot of developers find really useful for common scenarios.

    3) Where you are building an application (typically intranet based) where you need to support older browsers or have strict accessibility requirements that rule out modern JavaScript frameworks, and so must put a lot of UI logic on the server. If you don't care about SEO (because it is an intranet app) and don't care about having complete control over your HTML then using controls with built-in functionality can provide productivity.

    In terms of specific reasons to consider MVC for new projects:

    1) If you are building a public facing web-site where SEO, semantic URLs/HTML, and full control over the HTML is important. While ASP.NET 4 does provide a lot of new features for Web Forms to enable this - MVC still provides more total control.

    2) If you what to use a TDD workflow and/or easily unit test your app. While you can use the MVP pattern with Web Forms, MVC provides a core approach that naturally supports this.

    3) If you want to build a heavy AJAX client-side app, the total control over the HTML/URLs provided by MVC can be an advantage. You can still accomplish this with web forms (especially with ASP.NET 4) - but if you want total client-side JS control MVC is probably a more attractive option.

    4) If you want the ability to customize/extend almost every layer of the web-framework, ASP.NET MVC provides the hooks necessary to-do so. Want a different view engine, integrate an IOC container, etc - then MVC provides some nice hooks.

    >>>>>>>>>> If webforms is sometimes a "best choice" would that imply that writing such sites in a pure-MVC framework like Rails or Django be a mistake?

    My meta-point with this blog post is that most technical debates are not black and while, or zero-sum (meaning one must win and the others lose).

    >>>>>>>>>> Why have no other frameworks, languages or communities emulated WebForms?

    Actually - several have. JSF (Java Server Faces) is one very popular clone.

    Seaside is another framework that is less widely used (but gets a lot more credit technically than JSF). You can read more details about it here: http://en.wikipedia.org/wiki/Seaside_(software)

    Ironically JSF (which I had assumed was long dead years ago) - is still apparently alive. I just looked at some jobs technology report and apparently there are still more active *new* job postings that mention JSF in them than Rails or Django. Very weird but true. FWIW there are still more *new* job posting that mention "web forms" in them than JSF, Rails and Django job posts combined.

    Hope this helps,

    Scott

  • @Tyrone,

    >>>>>>>>> Karl: Look what you started. I should have known when I saw that topic "The WebForms Rant" I should have hit the back button. Your blog post was pretty much a slap in the face to Scott and his team since they were the original creators of ASP.NET. I don't mind the criticism; but your language and tone completely turned me off and I'm sure other as well. You even manage to tick off "The Gu", which I thought wasn't possible.

    I actually wrote this blog post several days ago (before Karl's post) in an email I sent out to a listserv that was in the midst of a debate. They liked the email and encouraged me to share it as a blog post. I didn't post it in response to any specific blog post or comment - more in response to a number of threads where people have been having these discussions.

    And lest people thing the Web Forms vs. MVC debates are heated - just keep an eye on some of the other fun (non .NET) technical debates on this month. I wouldn't say that the tone of our .NET discussions is too different than any other communities.

    Hope this helps,

    Scott

  • @Claus,

    >>>>>>>> "c) Great developers using bad tools/frameworks can make great apps. Bad developers using great tools/frameworks can make bad apps. Be very careful about making broad assumptions (good or bad) about the quality of the app you are building based on the tools/frameworks used."

    >>>>>>>>> This seems like a argument saying that everything the Visual Studio team does is completely pointless? As a developer I adore the amount of perfection the teams around the .NET technology puts into perfecting the development tools, which is a much higher standard than the rest of the industry. Frameworks, APIs, handy code syntax (thank you for 'yield' in C#!), and development tools allows us to focus on what we actually want to create, rather than having to focus on the actual building process. If we were to completely ignore tools and APIs, we would all be coding our websites in Rails, on Linux, in Emacs. The main reason for me to even bother developing in ASP.NET is the reasons you say aren't the main focus in this post. Which is confusing, so to say.

    I wasn't implying that good tools/frameworks are a bad thing! :-) On the contrary, you should use the best tools/frameworks you can.

    What I was trying to point out is that developers do matter the most at the end of the day, and apps will not automatically succeed or fail simply because of the tools/frameworks.

    Hope this helps,

    Scott

  • Thanks Scott.

    I agree on the points you have written in the comments of "ASP.NET Web Forms / ASP.NET MVC debates". I personally feel much comfortable working with ASP.NET Web Forms and I simply love it.

    After reading your comments, I feel more confident doing more R&D in Web Forms.

    Thank you

  • All the points are valid. But what mostly strucks me is that our blogs[some cases] have become more or less a place for critics or regligious war rather a construtive one. Its all about taste and we can't just say someone how sily he is because he uses one framework over the other because i think that framework A is the best one. In the end, it matters all what we produce with the support out there, may it be a framework or concept that will make our lives better. It is always to good have options. It is unlikely we drive cars from same vendor and style.

    Just my few cents,
    Mehfuz

  • Any commentary, however well-reasoned and cleverly stated, that states, in essence, "the way I recommend you do things has tremendous value, and the way others do things, differently, is essentially valueless" is an extreme position. Extreme positions tend to be wrong.

    Additionally, communication with others in a friendly, open-minded and respectful way, is just the right way to communicate, whatever the topic.

  • Well put Scott. Healthy conversation can be good and rewarding to both the participants and the listeners. But at times, I often feel like watching a soap opera (.Net 90210).

    Let's build great and useful software!

  • Web Forms is better, noobs! :)

    Now seriously I just want to add one more use case for Web Forms. Our project is a wiki/blog style application where the admin can add different "widgets" to every page. The widgets do different things like display info about latest posts, latest comments, rss, etc. Everything is loaded dynamically based on configuration stored in the database. I believe there is no better abstraction for our widgets than a Web Forms control. They can encapsulate everything like talking to the business layer, design and behaviour.

    On the other hand we are an AJAX heavy project and we suppoert themes so sometimes we (especially the front-end devs) wish we had more control over the markup but ultimately I think Web Forms is far better choice for our project.

  • (joke) ok, ok, respect, respect, but C#, not vb, is for intelligent people :P

  • Speaking about tutorials you should publish more for your Expression suite. There too few books out there and we need to learn more about those products.

  • Thanks Scott for this post, A eye opener for many who just jump into debates and concludes to nothing.I am SL MVP and like ASP.NET and MVC,most of my time goes in pulling out clients from baseless Silverlight Vs Flash debates and show them the reality and Power of SL without discouraging their faith in other technologies.Some smart people also these days debating on "Will SL replace Ajax?" Silverlight and Ajax and existence of Ajax especially the way SL growing faster."General Observations About Technical Debates" part of your post..A must read !

  • Hi Scott,

    I have been building websites for the last 15 years starting out with Netscape servers, then moving across to IIS 1 and I've been mainly in the MS camp ever since. For the last 2.5 years focusing on developing sites based on the Umbraco framework which I have found excellent as a developer friendly CMS.

    I would be interested to hear your reasons for choosing Umbraco over other available CMS frameworks and also your view on the plans for Umbraco to be re-written around the MVC framework in version 5?

    Cheers Chris

  • Hi Scott -

    Thanks for the info on Umbraco. I'm always interested in a recommended CMS platform. CMSMatrix.org is overwhelming. Even better, it is free too, just need to buy support if you decided to go with the product. I tell you, there are so many out there. I'm in the middle of deciding which CMS platform to go with for my company so this was helpful. Just trying to avoid something I don't know... PHP.

    Sam

  • I just read the comments and responses. They were so informative I look forward to reading the entire blog post now.

    I think we need a Town Hall on this topic. People can bring signs and bullhorns. I'd be happy to come out and share some drinks and quiet conversation with tolerant, thoughtful folks like Scott at a nearby bar or restaurant during that event. (gotta keep the loud party crashers occupied :-)

  • A conundrum for you... what do you think is a better indicator of the quality of a debate? More people contributing or more people listening?

  • Great post scott.
    Love the detail about best scenarios for using either Webforms or MVC for new projects.
    It's just that for ME ... the reasons you gave for using MVC seem sooo much more palatable for anyone who wants to get the most satisfaction from their new projects, technology wise.
    Relating to the context of the post, 'Existing team knowledge, comfort, and code base is a big factor'

  • What I find ironic and mildly amusing is that the post was on the observation of debates over abstractions, yet the thread turned into a debate about abstractions. I was goaded into this debate briefly as well, just plain funny :)

  • Excellent post yet again well done. I broadly agree with "The interesting question to debate is not whether abstractions are good or not – but rather which abstractions feels most natural to you, and which map best to the requirements/scenarios/developers of your project."

    However... to me MVC seems like a natural step forward (probably because I had to fight to use it at my company), it's not just a matter abstraction, but it promotes TDD. We have recently delivered two large scale projects using TDD one using web forms and one using MVC. We had to compromise on unit testing the web forms project, namely mocking a http runtime which we didn't need to do with MVC.

    That said, I completely agree that we should be opened minded and select the most appropriate tool for the task at hand. I certainly don't think you are a bad developer if you select web forms (or java, ruby etc for that matter). However as Scott has said to make an informed decision, you need to understand the requirements as well as the technologies available, this is the responsibility of the developer. I do think managers and architects get too tangled up in we must use x and y because it is the "best of breed" or the "standard". We shouldn't box our developers into a corner saying you must use this and that, as we might miss out on a wonderful opportunity to learn something new. There was a time I was told in a meeting not to use MVC (ignored of course), because it was open source, wasn't "standard" and therefore wouldn't be supported, we have come a long way since then.

  • Claus said: "If we were to completely ignore tools and APIs, we would all be coding our websites in Rails, on Linux, in Emacs."


    Wait... what?

  • Hey Scott,

    Great post - very sensible ideals, always good to keep things in perspective.
    Sounds like a great guideline to follow for tech blogs/debates.

    Sounds like we could do with an acronym to sum it all up. I nominate KITS (Keep It Technical Sir :)

  • I am not so much interested to learn ASP.NET but PHP. I am new in PHP web programming and looking some helpful resources. Can anyone help me about it?

  • @Scott: Great post and great follow-up comments.
    I especially liked your comment with comparison of advantages of Web Forms vs advantages of MVC Framework.

    @Karl: Thank you for asking Scott questions I wanted to ask myself.

  • Right on!

  • Everywhere on the web, there are clearly people who get their charge for the day by bashing something. There are others who get their's by enthusiasm over some bump in technology whether or not it has much real value. But for those who are actually interested in using the technology for something substantial, good enough is a very real phenomenon. Microsoft made a large amount of progress over the last decade with .net, c#, and visual studio. By now, they are good enough for a very large range of programming work. It takes people a long time to become proficient with the current offering. Once they know how to use it, they are likely to find that it is already good enough for their needs. Most will not be interested in the continual disruption of Microsoft's obsession with the next great thing.

  • @ScottGu
    What do you think: what approach is more concise in terms of lines of code required for implementing typical web site: Web Forms or MVC?
    For the sake of comparison let's not use designers in either framework (designers are mostly useful for beginners anyway, right?) and count lines of code that developer has to manually write (ASPX and C#(VB) code).
    Would both framework require about the same amount of code written?

  • I agree with your meta-points about technical discussion, but the big question it leaves open is "is it ever acceptable to say that a technology or technique is basically bad".

    I think we would probably agree that creating bad libraries and technologies is *possible*, and there are many good devs who feel that in general this applies to webforms... You're very diplomatic though Scott, and probably aren't allowed to agree with that...

  • Item (c) under "General Observations..." is worth an article all by itself. If people would repeat this three times before trashing a technology, we'd all be better off.

    Thanks for a great, level-headed post.

  • I like debates. I think where it goes downhill is when one debater starts saying things like "You are wrong", "You are an amateur", "Come back when you have 10 years experience", etc... When it becomes personal while sometimes fun to read, it doesn't really help the debate at all.

    And I like both web forms and MVC. I don't mind abstractions or magic(convention) at all. I'm waiting for VS.net to take my verbal commands and write the code for me.

  • Great stuff can't wait for the tutorials
    long live web forms hello MVC

  • I use webforms because that is what I like, I found the webforms technology mature and have invested time and money on third party controls as well. However, I am learning MVC and have done a couple of small projects with it, I don't see a reason to use only one or the other... just do what you like as long as you do something great.

    Good luck!

  • Great post, I must admit that I've thought that ASP.net MVC was a bit of a ripoff of Ruby on Rails, why suddenly has everyone seemed to jump on the MVC bandwagon - but I've since adjusted my view and think that ASP.net MVC is a healthy platform using a nice architecture rather than "ripping off" Rails.

    Your post is very well put, I still think I would use ASP.net Webforms 90% of the time after thinking about the use, but you are right on when saying that the use/problem must first be thought out before deciding which platform to use.

    I will argue that maybe your own comfort level should not play a big role in this decision. For example, I feel more comfortable using webforms, but if I'm on a team that has 5 other guys that prefer MVC, why would I code in Webforms?

    Anyways, lots of factors and variables, most important from your post - ALWAYS have an open mind!

  • That's it, I'm coding in binary...

  • very nice and neutral view on the topic! i couldn't agree with you more!

  • Thanks for ALWAYS dropping science. Those "abstraction" paragraphs are great to read out loud in front of unsuspecting abstractionists. :)

  • I have many friends who swear by PHP. Whenever I create a perfectly functioning ASP.NET application, they could have done it "better in WordPress". Do you think that if ASP.NET hosting was cheaper, that it might persuade some of those people to try out ASP.NET? I struggle to persuade them to look at ASP.NET because they just see price tags around everything they do

  • excellent!

  • Well, one thing is for certain as a result of this post -- all around the world, thousands of developers are being asked to sort an array of numbers in the most efficient way they can as their opening interview question....

  • I've been programming with .NET since 2002 in parallel with PHP. Later I've moved to .NET as it was much better option with C# than PHP which was also not mature enough for enterprise size apps.
    Regarding Web Forms vs. MVC I'll vote for MVC any time. Why? - Yes, the control model of WF is great, it makes stuff faster, it makes stuff being built the way you build Form apps. Still, there are several drawbacks that always required hacks to put them the way I need and I really missed the flexibility of PHP that made ASP.NET feel like a bloatship.
    MVC is a great solution. Total control like with PHP and great extensibility while keeping C# and .NET power right there.

  • To be fair, meanwhile, I've also found myself re-creating quite a lot of WebForms functionality in MVC, especially the control part mechanism.

  • I'm not sure where my comment went but here it is again - or the approximation of it.

    If you are re-designing www.asp.net, please do not make MVC an alternate. Right now, MVC is a separate menu whereas Web Forms is the default. As long as you make MVC an alternate solution, it will stay that way. If you do intend to present both Web Forms and MVC as equally but different presentation layer for ASP.NET, I think you need to change the way you present them.

    Don't make one a default and the other an alternate.

  • Scott..

    Technical debates are a good thing. It's how things are discussed and how process gets better. The real issue is when one of your guys - Brad Wilson in this case - decides to offer comment and invite a response - and the deletes the blog post when it does not go his way. That's about as intellectually dishonest as it gets. Sounds harsh - but it is what it is...

  • Scott,

    I like your comment "In terms of specific reasons to consider ... for new projects". Would be nice to see this on the asp.net website or as a (P&P?) whitepaper. Helps devs/mgrs understand Microsoft's vision for these abstractions.

    Raj

  • Developers need clear technical pros/cons comparison of ASP.NET Web Forms and ASP.NET MVC. Frankly I have a feeling that ASP.NET MVC is the direction and we were all told that ASP.NET WEB Forms is going to stay... But this might slowly change once ASP.NET MVC gets all the needed features.

    Giving general comments is easy and we can make everyone happy. But as a leader of creating technology - Microsoft should take the role of providing clear, strong technical/fact based pros and cons of each technology. Without which it is difficult to decide which option is better for a project.

    Your post is sure lot better than many other's post I read so far on this topic. Lot of times people escape easily by saying "It depends on requriement" OR "it is personal choice" etc.

  • I believe it is matter of chosing the right technology for the application.

    Personally I prefer hybrid of Web Forms and MVC. When developing any apps I perfer to use Web Forms for the Admin side because it provides rapid developmeent and for the customer facing site I perfer to use MVC. One of the main advantage of MVC is that you can have one controller and multiple Views; meaning you can target various devices and only write the business rules once(one controller).

    DataAnnotation Validation just ROCKS!!!! Greate work

  • The article remind me one sentence, which ends mosts of holywars like "F-16 vs MiG29" in russian aviation forum. "В умелых руках и хуй пушка". Hard to translate.

  • Thank you for the sanity, Scott! I think it's a shame that one's choice of framework can actually cause people to end/strain very worthwhile relationships with other developers.

  • Scott,

    I understand that you feel Webforms gets a bad rap for being a poor abstraction. You have to understand, me and others like me aren't saying it's not the correct abstraction, we're saying it's bad (bad output, lots of overhead). Webforms is to web design as Easy Cheese is to cheesemaking. Yes, you may be able to call it cheese, but it's horrible to eat.

    Mind you, I use Webforms every day at work. I'm just giving it to you how I sees it.

  • You didn't have to use up so much space to say absolutely nothing. You could have just creating an empty blog entry or even better skip this entry altogether.

  • Excellent article..
    Long live MVC and Web Forms, I feel that these 2 are like 2 eyes for .NET. I am enjoying learning new concepts of ASP.NET MVC 2.0 am waiting for more and more posts on MVC from SCOTT GU.

  • What a political, I'm the good guy post. Reading that felt like I was forced to watch some girly love story. Did Renee Zellweger help you write this?

    Web Forms = less headache. Less worries, it'll get done. Turn off the viewstate if you don't like it.

  • So, what is the best sort alg?
    .
    .
    .
    .
    JK

  • Good Post . Its true that both MVC and Webforms have their pros and Cons

  • So true...

    "The history of programming debates is one long infinite loop – with most programming ideas having been solved multiple times before. And for what it’s worth – many of the problems we debate today were long ago solved with LISP and Smalltalk. Ironically, despite pioneering a number of things quite elegantly, these two languages tend not be used much anymore. Go figure."

    Great post and I love ASP.NET MVC.

  • Great blog post Scott!

    This post was much needed for the community at large.

    Keep up the great work :)

  • Great job on this post!

    This post was much needed for the community at large.

    Keep up the great work :)

  • Are Projects successsful? are IT intuitive?
    babel IT knowledge?

  • With the CMS framework you decided to use, did SharePoint come into the mix ?

  • That was an excellent post.

    I haven't used MVC yet as our dev shop isn't quite up to it yet, so I'm looking forward to the new tutorials.

    I appreciate all you and your team have done.

    Thank You.

  • I do agree with you and would like to add something, If a person inform is not getting what we mean, it is probable we are not able to explain properly. This point, if understood, could cut the length of debates, short. Remember a students failure is a teachers failure.

  • Very enlightening post.

  • You had me at hello.

  • That's weird googlefight is now saying web forms is in the lead, it keeps changing results after a few refreshes.. lol, web forms in the lead, that CAN'T BE RIGHT :P

  • As a Microsoft partner that delivers Ajax components on Web Forms, we would like to show how you can do MVC with great success on Web Forms, without ASP.NET MVC:

    http://blogs.gaiaware.net/post/MVC-on-ASPNET-without-ASPNET-MVC.aspx

  • I do agree with DaRage. After all we just cant take everything coming out from any BigB's mouth, especially when their paychecks are coming from Microsoft.

    Irrespective of what you believe, fact remains that MS did not came in MVC land rather it was forced. Given it's total investment in WebForm land, it make no sense for them to talk about not using it any more. After all, business run's with money and no company is foolish enough to pay for speaking against their product/service. And no wonder that MS is not an exception.

    Now c'mon you MS guys. Grown up and have courage to speak the reality.

  • I’m wondering why in such WebForms vs Asp.Net MVC debates, very rare Web Client Software Factory (WCSF) is mentioned. You said that one of the reasons to consider MVC for new projects is: “2) If you what to use a TDD workflow and/or easily unit test your app. While you can use the MVP pattern with Web Forms, MVC provides a core approach that naturally supports this.” and very often it’s stated that using Asp.MVC helps to achieve TDD and SoC. But it looks like witch WCSF you can accomplish it as well, yet still using WebForms. So, what’s the real advantage of Asp.Net MVC over WCSF?

  • Great post. Addressed the real issues that everyone has in their day to day working life. Excellent post. thanks a lot.

  • Thank you so much :) truly amazing... Was a pleasure to read

  • It is not about what tools you use, it is about what you make with these tools.

Comments have been disabled for this content.