ASP.NET MVC is MUCH better than MS seems to think
Here at DevConnections I just attended the ScottGu’s keynote on Visual Studio 2010 and Web development. I haven’t had much time to spend on the latest Beta of Visual Studio 2010 yet so I found most of the information quite helpful and interesting. It looks like Microsoft is finally coding some good functionalities from ReSharper and .NET Reflector inside of Visual Studio 2010.
Little gems like “Generate stub method” or “Display the hierarchy of calls” are now available natively. Still ReSharper is a must I think, but it is good to have a really better VS. By the way, I haven’t seen yet a preview of ReSharper for VS 2010 so the gap might still be quite large J
My primary focus these days is for ASP.NET MVC as I’m doing—guess what—a book scheduled for the release of the .NET 4 platform next April. I particularly loved the TDD spin of ASP.NET MVC that is visible from tooling support. I’m not simply emphasizing the possibility of doing unit tests; I’m referring to the possibility of writing tests first and then the code. And here’s that facilities like stub method and types generation come into play.
And finally, I respectfully but strongly disagree on the slant of many Microsoft presentations that touch on ASP.NET MVC. I disregarded ASP.NET MVC for too long. Now that I got to know it from the inside, well, it’s the best (large) piece of code I’ve seen for a long time.
It’s much better than MS seems to think and tell.
In my opinion, it really represents the way to go for most developers in the mid term. It is probably premature to suggest today that Web Forms be abandoned to embrace ASP.NET MVC. But the new framework (in version 2.0 with Visual Studio 2010) drives you toward better code. Don’t get it wrong: ASP.NET MVC doesn’t automagically make your code clean, elegant and flexible. You still have to go a long way ahead but it puts you on the right track and delivers an environment where you can write testable and practice seriously with unit testing.
A point that Scott made about ASP.NET MVC is that it gives you total control over HTML. Not that this is a false statement, but it happens because server controls are marked as evil. They still work (even though their use may compromise the design—hold on) if you want and if you use the increase your distance from HTML. But on the other hand, if you stop using server controls in Web Forms you get closer to the HTML metal also in Web Forms. So in the end the reason for using ASP.NET MVC is Separation of Concerns and testability.
Eventually, Microsoft will be able to add that to Web Forms too, perhaps via the MVP pattern as the Web Client Software Factory framework attempted to do a while back.