views:

317

answers:

6

I'm an experienced desktop client developer in FoxPro, and I've started learning C# in VS2008 for object oriented programming. At this point, I've never worked on web-based data access apps. In moving to .NET, I want to learn web-based programming rather than desktop client-based, and my focus will be conventional Line Of Business apps.

So, I'm wondering if should I just skip ASP.NET WebForms all together and start out with ASP.NET MVC. Will that hurt me when working with peers or possible employment down the road if I only know MVC and can't (never did) work in a WebForms / ASP.NET 2.0 environment? All that post-back and state stuff sounds complicated and painful from what I've read, and I'd sure love to skip right over it.

I've got basic HTML knowledge, and I've poked around with WebForms enough to get a Master/Detail page working (screenshot at http://twitpic.com/2j5mv), using DataSets and ASP.NET 2.0 Server Side Controls, but I'm kind of ready to stop already and poke around in MVC now.

I don't want to cut too many corners in my early .NET career, but I don't want to waste time either. If ASP.NET MVC becomes a major platform for web development, maybe I am coming in at just the right time. But, I know you've got to walk before you run.

+7  A: 

Basically, being a good Web developer requires knowledge about how the Web works more than the specific platform. This is important especially when you are coming from a desktop application background (i.e. a stateful world). I believe ASP.NET MVC is a cleaner way to get started as you get your hands on the details more than what you do in Web forms. This is not to say Web forms is the worse approach to Web development or it is deprecated or something like that. No. I'm just saying I prefer ASP.NET MVC for diving deep into ASP.NET. Nearly everything you learn in ASP.NET MVC is also applicable to Web forms world so you are not missing much.

Mehrdad Afshari
+1. Excellent. Wanted to right something on this lines. Would vote it thrice if allowed.
this. __curious_geek
+4  A: 

Both ASP.NET WebForms and ASP.NET MVC are built on the core of ASP.NET. I would recommend MVC to anyone who's looking to get into web development just because I've spent years in WebForms and I've been using MVC for over a year now.

I would though, recommend and also learning the other to help keep your toolbox full in case you ever need to develop with one or the other.

Chad Moran
+1  A: 

I think a lot of the things you'll learn will be common to both - given you're new to .NET. So I guess I wouldn't worry too much about the choice of framework for now.

Learning MVC may be helpful if you have to use another web framework (e.g. Rails) during your career.

If you are intending on using a lot of third-party controls on your site, some of those may be more suited to the WebForms approach.

Of course, you can mix and match.

stackoverflow uses MVC, I think. Although I have memories of hearing the authors mention on a podcast that there's a little bit of WebForms too.

I've found MVC to be easier to manage when I'm working on bigger projects. But WebForms is quickest when I'm knocking up two or three pages.

dommer
+1  A: 

I would not worry about ASP.Net webforms. I've been predicting for a while now that the writing is on the wall for WebForms, and it's coming to pass - we're seeing a full paradigm shift in my industry (online mapping) from webform apps to REST apps. I doubt that 5 years from now Webforms will make up more than 10% of my work.

ASP.Net webforms were configured for out of the box ease of use for less experienced developers putting together web sites. Sure, you can optimize a webform app and customize the HTML down to the response level, but then you're bypassing a lot of what was built for you. Doing that is a lot of work! Demand has never decreased for optimized, lightweight and responsive websites - in fact, it's increased dramatically.

The takeoff of frameworks like Django, JQuery and Dojo have also started to negate the need for complex webcontrols. Developers no longer need to package up arcane and magical javascripts into resource files and distribute them with the .dll's, or worry about writing cross-browser code. People are doing it for them.

I would go to sleep happy with starting with ASP.Net MVC, and not worry about it. As other posters have mentioned, all the architecture you will be learning is the same, and you can use any WebForm stuff that you'll need if it ever comes down to it.

womp
I read your blog post. Seems dead-on. But, I'm just a beginner, so I'm an easy sell. Thanks.
MattSlay
+6  A: 

Perhaps just to be contrarian, I'll suggest starting with WebForms. It's a lot more established - especially for LOB apps - and you'll find a lot more info on it than the just-out-of-beta MVC.

I haven't used FoxPro since somewhere around 2.6, but I think that the move from FoxPro to WebForms would be right around the sweet spot that VB6 devs had. Most of the folks who are falling in love with MVC have previous web experience in things like Ruby, Python, or Java MVC frameworks - they're not desktop devs.

MVC has some pretty severe OOD overhead. Throw in the recommended mixes of dependency injection, mock frameworks, and unit testing - and you've got enough jargon to keep you flailing for a while. You'll have quite enough to learn with the 30,000 BCL classes, HTTP, HTML, CSS, JavaScript, ADO.NET, etc.

From a career standpoint - as a LOB dev - you will be doing WebForms as well. Just because MVC is the darling of the blogosphere, doesn't make it the darling of Fortune 500 apps. Even if new development is (somewhat miraculously, IMO) slated for MVC, there's millions of lines of WebForms that will need to be maintained and extended.

Mark Brackett
you are correct. MS is irritating a lot of architects and leads who staked projects on winforms by talkinga bout MVC almost like its the second comming. It may be, but a lot of devs dont like being surprised or appearing to have made the wrong recommendation
MikeJ
Wow... I would suggest that there are some architects that need to seriously step back from the politics a bit. Web forms didn't magically degrade when the MVC framework was released. If it was viable enough to recommend before, it would be just as viable for exactly the same reasons now.
Stephen M. Redd
+1  A: 

Microsoft is naturally excited about the new things they are working on and have just released. One must be careful not to mistake their excitement about MVC for the death of Web Forms.

MVC hasn't been annointed - it has only just been born, and the parents are handing out cigars and insisting we all look at pictures of their newborn baby. I'd suggest we all wait a while to find out whether the new kid is a genius or an idiot.

Also, keep in mind that most of your potential employers haven't yet used MVC - it was only just released a week ago! Chances are, even if MVC is a great success, it will be many years before the number of MVC opportunities equals the number of Web Forms opportunities.

John Saunders