Keyvan Nayyeri

God breathing through me

Do not Blame ASP.NET WebForms

Photo taken from http://blogs.sun.com/jimmo/resource/argue.jpg with modifications As much as we get closer to the final release of the first version of ASP.NET MVC by Microsoft, the number of community debates about the advantages of ASP.NET MVC over ASP.NET WebForms increases.

In the past week we saw some reactions by the community arguing that ASP.NET WebForms is weak, and somehow implying that ASP.NET WebForms is something terrible and developers shouldn’t use it.

It’s really interesting to see such turning points by those who have been using a technology for at least a few years, and most likely have built some projects with it. It’s also very interesting to see the reasoning that some people have and very logically (sarcastic) support their opinions!

As a side-note for some dear readers, please spend time to read a blog post completely and understand it before leaving your comments. In the past week I received a vast majority of controversy comments on my blog posts with the same style that were obviously left after reading a part of the post without a good understanding!

First of all, I have to disclaim any biased position by myself. I’ve been using ASP.NET WebForms in a professional level for these years, and was one of the early community members who actively joined the wave of ASP.NET MVC, and provided content on the community. I’m also writing a book about ASP.NET MVC and have more plans to contribute to this community.

Having all these said, I never can assert that one of these technologies is absolutely better than another. I stated that several times and repeat it again that each of these two technologies is suitable for a scenario and works as a great solution for its own problem. While I will use ASP.NET MVC, I also use ASP.NET WebForms actively maybe more or less than ASP.NET MVC, but it only depends on the problem, requirements, and timing pressure.

I also want to say that it’s the nature of mankind especially in the last couple of ages to take biased positions for or against a phenomena. Although this is an important factor in the progress of societies, it can also turn to something negative that stops the progress. I think that we should take dogmatic actions when we have enough knowledge in that field, and more importantly when we have thought about that phenomena very well. Many times we support an idea only and only because we like it for some superficial reasons.

Extending this discussion to the .NET world, you surely can remember the era after the birth of the .NET Framework, and serious arguments about C# and Visual Basic to prove that one is better than another. I think that many of these people knew that there is almost no difference, but they were wasting time on this topic. What did happen in the end? Do you see such arguments anymore? Could one group overcome the other and convince them? This is just an example of such dogmatic approaches to face with phenomena in our world. Of course, you can be sure that supporting The Reds is a wise decision because in the end they’re the champions!

I don’t want to digress, so let me get back to the recent debates about ASP.NET WebForms and ASP.NET MVC. I don’t think that this is something helpful for the community and no one can give enough evidence to persuade everybody to accept his sided opinion.

In my opinion there are some people employed in high tech that are sick of adapting quickly to the newest technologies and applying them. This was something that I had written in one of the chapters of our upcoming book when I had talked about migration from ASP.NET WebForms to ASP.NET MVC, and had tried to make it clear that in many circumstances migration is not necessary. Don’t get me wrong because I don’t want to count on these people and discourage them from using the newest technologies. I’m one of these guys and I usually use and apply new technologies as soon as they are introduced to the public and long before their are stabilized, but the point is that we shouldn’t drop our brain for everything new. Something new is not identical to something better even if it’s better, we should understand that it takes time for the ordinary users to get and use it.

ASP.NET WebForms is a great option for web development as is, and it’s been used quite frequently in different scales for different purposes (White House is just the latest famous instance). While it has some weaknesses in some areas that are related to the development effort and testing scenarios, it’s been such a powerful technology to serve for all these scales and purposes very well.

The development effort for ASP.NET WebForms is comparatively less than its competitors and also less than ASP.NET MVC development because it offers a good set of built-in features that help acceleration of web application development.

ASP.NET WebForms manages the state persistency behind the scenes. This can be good or bad and one of the main facts that is used to criticize this technology. But if we logically think about this, we can be sure that in many cases this has served as a positive factor. Do you think that you’re always ready to write the extra code for managing the state?

Besides, ASP.NET WebForms offers a set of server controls that ameliorate many tasks in web development. This can be a negative point as well because it doesn’t give you any control on your rendered HTML code, but again, it’s not a generic case.

Moreover, one of the hidden advantages of ASP.NET WebForms is the development model that it offers. ASP.NET WebForms has allowed many Windows Desktop developers to apply their existing knowledge with least possible extra learning to web development because it offers the exact same model of control and event handling mechanism in development. But ASP.NET MVC mandates a new learning process for its own. Of course, this isn’t a disadvantage for MVC, but it’s an advantages for WebForms.

I don’t want to go over all the advantages of ASP.NET WebForms and list R reasons to support that it’s better than ASP.NET MVC because it’s not. As I said before, I’m not 100% positive about WebForms because it’s very classic, doesn’t allow a straightforward mechanism to control your application, and also doesn’t provide a good separation between project concerns and components. As I wrote a few weeks ago, in my opinion the development strategy of WebForms is a good example of the way that Microsoft is developing its kingdom by getting inexperienced people on board, but this cannot erase all the goodness in the product.

On the other hand, while I love ASP.NET MVC for the level of control and separation that it offers, I may not use it for a project that I want to develop in a smaller scale or under time pressure. I think that everybody who has developed a few projects (even small) with both technologies can verify that usually ASP.NET MVC takes too much work to perform a task that ASP.NET WebForms does even with no line of code!

However, what I want to say is that there is no point in opening a new thread to argue which technology is better because none is better. We may see new ASP.NET derivations in the coming years to solve their own problems. Should we stick with them and neglect anything else? Even though it’s a topic for a separate post by me but to make it short, Microsoft has proven to be in the transition from general software development technologies to technologies that target specific scenarios and we should consider this very well. I just cite the recent post by Scott Hanselman about the greatness of ASP.NET Dynamic Data for its case where it’s much better than ASP.NET WebForms and ASP.NET MVC both.

The last note is that despite the similarities between ASP.NET WebForms and ASP.NET MVC that are actually the core APIs of ASP.NET infrastructure, these two technologies are very different with different models that makes it difficult to compare them in lower levels. I think that the only way that we can compare them is as two web development technologies, something like what we do to compare ASP.NET WebForms with PHP or Ruby.

Finally, I’d like to suggest everybody spend his time providing valuable content about both these technologies rather than wasting time to criticize them. It’s over a year that almost all the famous online .NET communities have hit a lower level of activity in the area of technical articles, and we can help them in our spare time.

6 Comments

Do Not Blame ASP.NET WebForms
Jan 22, 2009 11:30 PM
#

Thank you for submitting this cool story - Trackback from DotNetShoutout

Pingback from Dew Drop - January 23, 2009 | Alvin Ashcraft's Morning Dew


Speednet
Jan 23, 2009 11:21 AM
#

Thank you for the nice discussion of WebForms and MVC.

The thing that worries me about MVC is that is sucks oxygen from Microsoft and developers. I would rather see more effort placed on improving ASP. NET AJAX, IIS7, and other vital technologies, even to the VB and C# languages, than to starting a completely new programming model.

If there were weaknesses in WebForms, I wish Microsoft would have addressed them in the existing model, rather than creating a completely new model. If you can't control the HTML out well enough, then they should have spent some time and made a good solution for it in WebForms. Etc., etc.

I would probably have looked into MVC, except my brain is on overload with all the various technologies Microsoft is producing these days. One person simply can't "learn it all" anymore. Hopefully the Microsoft empire doesn't grow too wide to control.

-Todd


Keyvan Nayyeri
Jan 23, 2009 11:26 AM
#

@Todd

As of the growth of Microsoft technologies and their inability to manage it, you shouldn't worry. As I said, they're moving toward specialization and you can expect more products focusing on specific scenarios after this. Besides, they're the biggest software company that have proven to be able to expand their work without such side-effects.

As of weaknesses of WebForms, to be honest, it wasn't possible to address them in the same product. The development model for WebForms doesn't allow these issues to be resolved.

Finally, you can feel free to not use MVC at all. It depends on your own requirements. If WebForms works well for you, you may prefer to spend your time on other technologies that can assist you in your career.


Speednet
Jan 24, 2009 11:44 AM
#

My comments mainly come from the fact that although Microsoft is hugely capable of massive numbers of technology teams, even Microsoft has limitations. This limitation was one of the reasons Internet Explorer languished for so long. Microsoft shifted priorities elsewhere, and the development team was disbanded.

I definitely see the effects of Microsoft shifting focus away from their ASP.NET AJAX initiative. Yes, there is still some new work being done, but at a vastly subdued pace. You can directly see it in the lack of progress in the AJAX Control Toolkit and other such projects.

I'm not voicing any kind of criticism of MVC at all. I do think some of the problems it solves can be addressed in WebForms, and I guess that is just a point of disagreement between us.

For example, there are a number of ways of handling routing with WebForms that solves the core issue. They might not be precisely like the MVC solution, but they are there. (I think .NET 4.0 is even building in support for routing into WebForms, no?)

Separation of functionality from design can also be accomplished in WebForms. Again, not in precisely the same way, but it can be done.

I guess I'm more pragmatist than purist, so others may disagree. My gut sense is that Microsoft has lots and lots of technologies that are staying in "release 1.0" for too long, and again, my GUT says that they are spreading thin. It's just based on what I see and read, nothing more.

Pingback from ASP.NET MVC Archived Blog Posts, Page 1

Leave a Comment





Ads Powered by Lake Quincy Media Network