Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Webforms vs. MVC. Once you start using MVC.. Do you ever go back to webforms?

I checked out MVC months ago and didn't really get it.. but recently as I have become a better programmer I think it is making sense.. Here is my theory.. tell me if I got it Right

In the 90s for Microsoft Devs we had Classic ASP. This mixed VBscript and HTML on the same page. So you needed to create all the HTML yourself and mix HTML and VBScript. This was not considered Ideal. Then .NET came along and everyone liked it because it was similiar to event driven VB 6 style programming. It created this abstraction of binding data to ASP Servier controls. It made getting Enumerated data easy to get on the screen with one line. Then recently Jquery and SOA concepts are mixed together.. Now people think.. Why create this extra layer of abstraction when I can just directly use .NET as a data provider and use jquery AJAX calls to get the data and create the HTML with it directly .. no need for the Webforms abstraction layer..

Sowe are back to creating HTML directly like we did in 1999.

So MVC is all about saying Stop pretending like WEb programming is a VB6 app! Generate HTML directly!

Am I missing anything?

So I wonder.. for you people out there using MVC... is it the sort of things that once you get used to it you never want to go back to webforms??

like image 695
punkouter Avatar asked May 11 '10 15:05

punkouter


2 Answers

God, I love MVC so much I don't even think words can capture how I feel :)

From time spent developing something viewpoint, I think that MVC and WebForms are equal.

In WebForms I would spend many hours fighting with DataGrid and other controls to do what I want and how I want it. And not to mention many many hours replacing UpdatePanels with jQuery from sites where it wasn't a viable solution anymore (performance wise).

In MVC I start with a blank slate and mold it to suit my needs. Need I say more?

EDIT: I just found http://aspnetmvc.componentart.com/

like image 150
Vnuk Avatar answered Nov 09 '22 23:11

Vnuk


There are times when I wish I could just plug in a grid or datareader, hook it up and it just works, like I did in ASP.NET. Making applications in ASP.NET MVC is arguably more work. But then I remember all of the nitpicky things I had to deal with in ASP.NET, like ViewState, code-behind, and magic id's. The page rendering pipeline was so opaque to me that I never really got the hang of using the code-behind events properly.

ASP.NET MVC just seems cleaner and better organized, and I have far finer control over my application and its markup.

That said, I am glad that you can intermix ASP.NET and ASP.NET MVC pages, because there are some things you can't do in ASP.NET MVC, like use server controls. The new enhancements in ASP.NET 4.0 should make it easier for dedicated ASP.NET developers to produce applications with finer control over their markup.

like image 41
Robert Harvey Avatar answered Nov 10 '22 00:11

Robert Harvey