MVC vs Web Forms in EPiServer 7
You have a choice which one to use when you are building an EPiServer 7 website. IMHO this option is only to give developers familiar with Web Forms, some time to jump to MVC. Like there was Visual Basic .NET together with C#, and the first one is of course slowly dying now.
I have been developing on EPiServer 7 for one year now (almost from start). First four months with Web Forms and it was last time I used them. From then until now I am working with MVC.
Pros of MVC
- Joel Abrahamson writes a book about EpiServer 7 (in MVC, only side notes for Web Forms). Last update.
- As I look on blog posts on http://world.episerver.com/Blogs/, most of them write in MVC, and with a time it will be more and more.
- There are concepts that are built in like friendly URL, WebAPI (no need to use external libraries like Nancy).
- MVC is the next generation, has better separation of concerns (Model/View/Controller), while in Web Forms you create by default mixed/spaghetti code.
- Because of above point writing code in MVC is more fun, Razor views means less code, generally better IoC, testing, etc.
Pros of Web Forms (I don’t suffer from any of them, but they may occur)
- You have no experience in MVC and don’t want to experiment with new technology. It requires learning – no doubt.
- There is some code that you need written in aspx markup that works fine and will still work (i.e. in Admin Mode) so you don’t want to develop together Web Forms and MVC.
- Honestly I don’t see any good reason to start new project with Web Forms. But please share in the comment, when you see any.
This article is sponsored 😉 By my desire that 3 developers that are right now starting next project will choose MVC. And there will be another new MVC project in Making Waves.