The predicate

I have a theory that you can tell if a Microsoft web developer is good or not based on as single question.

Would you choose webforms or MVC on a new project?

Many readers probably consider this obvious, perhaps even equivalent to the choice between punch cards vs keyboard/monitor. I suspect most people reading this consider the logical choice, and only an idiot would choose otherwise

However, I suspect most Microsoft web application developers would still chose webforms … scary as that is.

I think that right now, MVC has really separated the good from the bad, at least as far as developers go. Developers on top of their game have at least overview experience with MVC, yet most weak or lazy developers haven’t been forced to make the leap yet, as a result they either haven’t looked into it, or have been so confounded by the paradigm shift that they’ve passed it off as a trendy fad.

Please notice I said ‘choose on a new project’, not ‘currently working in’. I’m sure there are many developers who are working in webforms who would prefer to be working in MVC … I’m one of them. On the flip side, I recently met a developer working in an MVC app who wishes it was webforms.

There is a presumption in my statement, that MVC is inherently better than webforms. To most of us, this seems obvious, but there are many who disagree … and that’s fine. However, I’ve yet to find a valid argument for webforms over MVC.

… don’t get me wrong, I’ve heard people tell me that webforms is better, but I’ve never heard a rational argument. Those who have tried have basically given me buzzwords like ‘event-driven’ but fail to contrast it against, or even recognize the cost of that paradigm.

Take for example; answers to this Stackoverflow question When to favor webforms over MVC? I’m not going to argue about integrating MVC into an existing webforms app because I think maintaining technology consistency is important. But some of the other reasons include :

  1. Leveraging existing training – True, but good developers usually keep their skills up to date, so is this really that big of a deal?
  2. View/edit modes makes duplicate work – This is actually better than all edit pages, yes … even for enterprise apps. If you don’t believe me, just think about all the functionality you added to ensure users couldn’t ‘save’ … there’s no save button issues when they can’t even access the edit form.
  3. Too many files – Don’t forget all those files allow for Single Responsibility and Separation of Concerns.  Basically they encourage a cleaner code base.
  4. Issues with the master page consistency – This sounds more like an application issue than a framework issue.
  5. Recognizable directory structure – You quickly get used to the MVC directory structure, and basic routing isn’t rocket science.
  6. Powerful controls – True, but all that functionality will be ported to the MVC paradigm eventually. And for what it’s worth, I think partials are better than user controls.
  7. Webforms is a shortcut to web development for Windows developers – True, but isn’t this the epitome of a bad dev? They don’t want to actually learn the tools they’re working with?
  8. Views & controllers are combined in webforms – True, but separating them makes good programming practice like the Single Responsibility principle possible.
  9. Somebody even suggested the page lifecycle gives you more control – Wow. Place a delete button on a grid row, then tell me this when you have to load the grid twice in your postback; once in the Load event to wire up the event logic, and again after you delete the data.

But the biggest reason cited everywhere seems to be ‘personal choice’. … LOL … yeah, if you’re smart you’ll go with MVC, if you don’t know MVC, don’t understand it, and don’t want to learn it, you chose webforms.

BTW, it’s not even about webforms sucking. Webforms has a lot of stuff to avoid, but it’s not just about that …. MVC is an enabler. Basically the MVC paradigm dove tails with so many good practices which are difficult in webforms (at best), like; Unit Testing (and easy mocking), Clean code, Separation of Concerns, Single Responsibility Principle, etc…  I’d even venture to bet there’s a noticeable correlation between modern software development processes (like agile) in MVC teams.

There’s a possibility this is a temporary thing, but I suspect it will last a lot longer than anybody expects, because bad developers don’t move to a new platform unless they’re forced. And judging by Microsoft’s continued “MVC doesn’t replace webforms” stance, it doesn’t look like they’ll be forced for a while.

Now as far as the ‘business reasons’ for choosing webforms go, having an abundance of developers, doesn’t really wash. At least it doesn’t if you bought into my opinion that webforms projects will attract low quality developers, and repel high quality devs.

What if businesses chose MVC for ‘business reasons’? Instead of aiming for an ‘abundance’ of devs, they aim for good devs, and plan to pay their slightly higher rates with the dramatic savings in development and maintenance?

PS-I sincerely looked for a good reason to chose webforms over MVC. If you know of any good reasons to choose it over MVC, please leave a comment or send me an email.

One Response to “The predicate”

  1. I vote straight HTML/JavaScript and WCF – ditch the both of them 😀

Leave a Reply

Your email address will not be published. Required fields are marked *