Yesterday Microsoft announced new (beta) releases of a number of forthcoming web development technologies. [ Read HERE ]
A member of one of the mailing lists I’m on was very upset! He complained that TWO choices were two many (WebForms and MVC) and adding a THIRD (WebMatrix) was simply ridiculous. I know he was serious because he said “seriously” many times.
ScottGu posted an interesting opinion [ About Technical Debates (and ASP.NET Web Forms and ASP.NET MVC debates in particular) ] on his blog some time ago.
Now that I’m MSJoe and not the MisfitGeek, I’m trying to be more political correct (as demanded by management : ) ), and I don’t mean to call out that specific individual, but the email thread got me to thinking.
If you read the developer blogosphere, there are many thousands of developers out there that are sure they could do a better job guiding Microsoft Developer Platform Strategy than our current leadership, they just choose not to come be part of the solution, but in this instance someone was saying that “choice options” are a bad thing.
Now, no one was saying that THE choice (WebMatrix) was bad, only that having three different options to choose from was bad.
I think people complain about having choices comes from one of three things.
1.) I don’t want to have to MAKE choices, either because I don’t want to (or have the time) to learn about the choices so that I can make the right choice for my needs.
2.) Confidence issues. I don’t want to have to make a choice because I might not make the right one (or be able to defend it.) If there is only ONE choice then I can’t get blamed for it
3.) I already MADE my choice so no other choices should be needed by anyone, any where ever !
BAD choices can be bad, but have several good choices is just…. well, good.
So, I’ll talk about the three choices (and really there are more than three.)
1.) ASP.NET WebForms
It’s become fashionable in some circles to say “WebForms sucks”.
Look back a decade to when ASP.NET WebForms first hit the street and reflect on how WebForms was pure genius back then.
People were building “Client / Server” applications with Visual Basic, Borland Delphi, PowerBuilder, etc. and suddenly everyone needed to move business applications to the World Wide Web. ASP.NET WebForms gave developers a way to do that using the exact development paradigm that they had already been using for years in the Client Server world without having to learn much f anything about how the Internet or the World Wide Web actually worked.
It was a brilliant solution to the problem of the day – get developers productively building applications for the web with as little time lag and learning curve as possible !
ASP.NWET WebForms FTW !!!!
Only many years later has the technical abstraction provided by ASP.NET WebForms become a hindrance. (And really, only a hindrance to some developers.)
So if you are a web developer building applications with ASP.NET WebForms should you move to something else ?
There are LOTS of GREAT web applications built with ASP.NET WebForms. If it works for you – keep doing it.
Also, there are many different STYLES of development possible with ASP.NET WebForms.
If certain parts of the WebForms layer get in the way, you can probably turn it off, or not use it.
Don’t like ViewState, turn it off (at whatever level of granularity you like).
Don’t like the WebForms Controls, don’t use them (replace them with jQuery UI ! )
This 1950 Harley Davidson Pan Head has modern paint and an after market seat but is still an awesome choice !
I still write new applications in ASP.NET WebForms.
2.) ASP.NET MVC
Proponents say MVC is the “Modern” way.
MVC is a “Pattern” that has been in use for more than THIRTY years. ASP.NET MVC is an implementation of that pattern for building .NET Web Applications.
There are good reasons to choose ASP.NET MVC for your new Web Application Development.
- Pattern supported separation of concerns. (Though undesirable development practices can break this model.)
- Embrace (rather than abstract) the underlying nature of the World Wide Web.
- Strong facilities for Unit Testing.
- Well suited to “Agile” development practices.
Certainly one can do all those things with ASP.NET WebForms, but ASP.NET MVC was designed and built with these things in mind.
There is a rather steep learning curve to start working with ASP.NET MVC. The implementation relies heavily on development by “convention” which means you need to spend time figuring out where certain things HAVE TO go or what the names of CERTAIN things MUST be.
And, there are choices to be made such as with View Engine to use (Forms, Razor, etc.)
When it comes to UI you’re sort of on your own (which some of us really like) though there is tooling support built in for jQuery coding.
The most important reason for one to choose ASP.NET MVC is simple.
Because it most facilitates they way you WANT to build web software !
If I were building a new application that was going to be built and maintained by a single company I would probably choose ASP.NET MVC.
3.) ASP.NET WebMatrix
Ahhh, now for the “New Kid on the Block”.
This is the one the uber-geeks say we don’t need.
I say they’re WRONG.
ASP.NET WebMatrix is not an APPLICATION Centric development methodology (like ASP.NET MVC), it is a PAGE CENTRIC development model.
The first important thing to note in this regard is that MANY Web Developers simply PREFER this model for developing Web Applications.
MANY web applications are built this way without the mandatory implication of a specific pattern, without Unit Testing, without Agile methodologies, etc.
In fact, most of the MOST popular web applications have been built this way.
Classic ASP developers work this way. So do PHP developers.
WebMatrix is perfect for Web SITES – and much of what we use on the web are more “sites” than applications”.
The web “page” model also has a special place in community driven Open Source development.
Projects like WordPress have grown HUGELY successful due to wide spread community involvement. The page centric development model really resonates well because the learning curve for contribution is low enough to offer rapid satisfaction. One doesn’t need to “get” the architecture, etc to start building and sharing things of interest to them.
So, which to choose ?
Yea, I know we tend to like it when there is a clear winner, or at least when someone declares a clear winner, even if you disagree.
The problem is that there are “hard” criteria but in the end, preference wins.
Some people drive a sports car, others drive trucks. (I bought an SUV with a big v8 engine so I get utility and whiplash whan I stomp on the pedal.)
I can’t TELL YOU when YOU should choose, but I can tell you how I choose.
I choose WebForms When ……
I don’t have the issues with WebForms that some folks seem to have developed. I don’t find it that difficult to get under the covers and I don’t mind writing custom controls if I need to. Still, more and more I find that WebForms makes sense to me when I’m building “behind the firewall” applications.
- An app who’s UI can mostly be limited to the ASP.NET WebForms controls.
- An application that will be GRID Centric.
- An app that is mostly Data and the Screens that show / edit them. (Little “business logic” need be added.
- Rapid Prototypes or Use & retire applications.
I choose ASP.NET MVC When …..
- The app wants to be a “Web 2.0” type thing.
- The UI will need to be complex and or very interactive.
- The application will have a great deal of business logic and / or is mission critical.
- The app needs to have an extended functional lifespan and will experience evolutionary iterations.
I choose WebMatrix when …..
- The “app” is “Site Centric”.
- UI is king but data and business logic are minimal.
- I want the application to be Open Source AND I want it to take on a life of its own.
Still, I continue to work with all three.