Can ASP.NET state management be daunting for beginners?
To all you ASP.NET experts and beginners, do you look at a state management as a difficult and annoying task to do? If you were to start over with ASP.NET would you consider ASP.NET MVC and never have to deal with ViewState again?
Also , is it true that once you go ASP.NET MVC you never go back to ASP.NET Webforms (Unless of course your job requires tha开发者_开发技巧t)?
ViewState isn't daunting for beginners, it's daunting for experts. ViewState is awesome because it obfuscates state management away for beginner programmers and allows them to focus on writing code. It then comes back to haunt them later when they need to write something more advanced and realize ViewState has severe limitations and drawbacks but that they don't know how to do anything else.
As for ASP.NET WebForms, I must admit I first abandoned it entirely in favor of ASP.NET MVC (aside from supporting some legacy apps) but have recently found myself returning to ASP.NET for smaller projects. If I need something quick-and-dirty I generally turn to WebForms. If it's something larger that I'm going to have to maintain down the road I find MVC more appealing.
I think webForms is just an annoying technology. If you have the option to go with MVC you would never go with webForms.
I consider ViewState to be a subset of state management. I try not to deal with ViewState now, and only use it when I'm (usually) dealing with a legacy page or project. I consider it pretty evil...but, unfortunately, it sometimes ends up being a necessary evil.
State management, for a good number of web applications, is necessary and not very difficult or annoying to implement as there are frameworks in place for this. MVC also has support for state management.
I also think that whether to use MVC or WebForms depends on the requirements. There could be reasons to go to WebForms. I don't believe in writing off a technology when something new comes out -- you never know when you'll need it again.
I would prefer Asp.net MVC over ASP.net Webforms any day. With webforms developers are enticed to write spaghetti code .
精彩评论