Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

A young developer frequently hits me up for help with Asp.net web forms. Usually his problems revolve around the actual controls and how to manipulate them, rather than pure middleware type code. Since I work with Asp.Net MVC quite a bit I usually see simpler solutions to his problems, but he can not implement them because of the structure he is working in.

I have discussed this with fellow developer, and he feels that it would not be a good move. His reasoning is that if you remove the structure that web forms provides, the young developer will flounder and not be able to do anything. I, on the other hand, feel that by removing the built in abstraction of web forms and their associated controls, and just focus on HTML and the code he will be more successful in his projects.

Would it be a wise move for a developer in this situation to move away from web forms and start to learn Asp.net MVC?

share|improve this question
    
I've had similar experience with PHP. The biggest problem I had was that I couldn't find any tutorial that is coincise, error-free and would provide me with a base knowledge necessary to move on to framwroks like CakePHP. Every single tutorial I tried was pure crap. Then I tried frameworks and could not even get them set up (after messing with them for hours). After many hours of frustration, i threw in the towel and now am learning python and django. I would suggest you find this person some quality resources upon which he can build knowledge. –  Virtuoso Sep 22 '11 at 4:04
add comment

7 Answers 7

up vote 4 down vote accepted

As a very new programmer myself, I found MVC architecture to be easier to learn and work with. The entire notion of ViewState, code-behind, and form controls felt like it wasn't applicable outside the Web Forms environment and was its own development entity.

I'm currently in an internship using MVC 3 and my boss has always encouraged knowing and having more control over things in general, as opposed to a somewhat black-box approach with Web Forms. As a result, I feel as if I've learned a lot more than if I were to rely on drag-and-drop controls provided by traditional Web Forms development.

share|improve this answer
    
You are lucky. Being encourage to learn and expand your knowledge is one thing that is lacking in many places of employment. Take advantage of your internship, it sounds like a great gig. –  Chris Sep 24 '11 at 13:37
    
@Chris I definitely feel fortunate. My boss and I are the same age and see things on the same level. Fridays at the company are dedicated to learning something new not related to the project and my boss is always asking me to point out things I disagree with in his code. He'll even tell me move forward to next steps in my project only after I truly understand why I've done something to achieve the desired result. –  SCS Sep 24 '11 at 16:41
add comment

Definitely - If you are doing anything beyond drag and drop, WebForms is just a different set of complexity you need to learn.

Your colleague does have a point about providing structure, but there are better structures to use. I'd recommend learning to write jquery plugins instead of global functions - while not an enforced structure, it does give you a nice framework for working with individual reusable controls that can be built independently of the overall application.

share|improve this answer
add comment

IMO the answer to this question will vary from project to project. There are projects I find that are easy in MVC and there a projects that I find are a nightmare in MVC.

Knowing both would be a great position to be in.

share|improve this answer
    
That's interisting. What kind of projects do you think that are not suitable for MVC? –  Konamiman Sep 22 '11 at 13:36
    
One's where an underlying model is difficult to define. I wouldn't say "unsuitable", probably more a case of "this would be easier in webforms". –  AndrewC Sep 22 '11 at 13:38
    
@AndyC "easier" is a matter for preference. Personally I don't think it get any easier than MVC in .net web frameworks. But if you are way more experienced in web forms, you'll probably feel otherwise. And regarding the model, again it depends. Personally the first thing I design is my model, without it, how can you design anything else? –  AJC Sep 22 '11 at 13:44
    
@AJC Fair comment. I do really like MVC but I won't deny there have been times I have said "if I'd done this in webforms i'd be done by now". –  AndrewC Sep 22 '11 at 13:49
    
@AndyC Jeje, I know what you mean. Though my experience with web forms was slightly different. I hated drag and droping web controls and working with them. Most large controls, like grid views, I instantiated dinamicaly, rendered the html and injected it back to page via ajax. So it was more work for me... –  AJC Sep 22 '11 at 13:58
add comment

I used to work with web forms and have recently moved to MVC.net... I can't for the live of me think of any situation where I would be compeled to build another website in web forms, unless I am required to update one already built.

MVC.net actually provides better structure than web forms. It provides a defined pattern to work with and helps build more organized, maintainable and extensible code. If he for any reason needs to work with web forms, then the experience will help. Otherwise I would guide him into MVC.net and tell him to learn web forms when and if he needs it later.

An important note, its that it might actually be easier for him to learn MVC before he fully learn web forms, since he still hasn't engraved in his head the web forms event-based and stateful way of doing things, and can more easily grasp the action-oriented stateless MVC way.

MVC pattern is the right way to build web apps (People will debate on personal preference, but I believe when you get down to it, this is true). RoR, Django they are all MVC frameworks.

share|improve this answer
    
I agree also. I used to work with webforms for years, and since moving to MVC, I can't see a good reason to go back to them unless I'm working on a brownfield project. While I think going to MVC for my young friend might be good, he's going to have a hard transition to unlearn the web form way of working with the web. –  Chris Sep 23 '11 at 21:14
add comment

If they have a solid grounding in webby stuff (HTML, JavaScript, CSS, HTTP) then I'd definitely make the switch. But if he doesn't grasp the web well then I'm not sure taking off the training wheels would help.

share|improve this answer
2  
Sink or swim my friend. I HATED the Web form abstraction; HTTP Is stateless, so work with that rather than against it. –  StuperUser Sep 22 '11 at 14:55
add comment

Yes, yes, yes. Show him how serious programmers write web applications today. WebForms is basically a failed technology, ok for simple CRUD applications but inadequate for anything interesting. Consequently there is very little value in learning WebForms, while there is great value in learning Javascript, the HTML DOM, jQuery, REST, etc.

share|improve this answer
add comment
  • How well versed in the fundamentals is the young developer? Do they know inheritance, abstraction and polymorphism well or are they just getting started on this idea?

  • How well do they know design patterns?

  • How trapped are they in the structure of WebForms in their current work?

Those would be what would influence my suggestion as I could see if someone had the fundamentals then it would be logical to just learn both and translate back and forth between WebForms and MVC while someone still trying to understand the fundamentals may be overwhelmed at trying to juggle both worlds.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.