Skip to content


Should ASP.NET be Simpler: Why Less is More

simplicity-main_Full

When I first started using ASP.NET in mid 2001, it seemed so straightforward. There was only one *right* way to do something. The framework was manageable and after spending about 6 months working in it day-to-day, I felt like I pretty much knew the whole thing. In many ways, it was like the early days of Java in the late 90’s when I could get one O’Reilly reference (I think it had a tiger on it?) and grok the entire framework.

Now books on either framework span multiple volumes and even the best developers cannot keep it all in their head. You’re now forced to specialize, and even then there is a sinking sensation that you don’t know it all. It’s become harder to be an expert on ASP.NET and the .NET framework due to its exponential growth over the past few years. There are coders somewhere in a bunker at Microsoft that do nothing but crank out new framework classes. And they’re writing them faster than people can keep up.

The Paradox of Choice

In some ways, choice is good. We now have many many options about which ORM to use (NHibernate, LINQ2SQL, EF, etc). But all of these options also causes stress and sometimes inaction. It’s called the paradox of choice and is expertly chronicled by Barry Schwartz in his book:

    Participants … showed the pattern of reluctance to make trade-offs whether the stakes were high or low. Confronting any trade-off, it seems, is incredibly unsettling. And as the available alternatives increase, the extent to which choices will require trade-offs will increase as well.

Have we reached the point where we have too many choices and trade-offs in the ASP.NET world? Let’s look at our choices for IOC containers from Hanselman’s Blog:

Castle Windsor based on the Castle MicroKernel.

StructureMap has been around since June 2004

Spring.NET Licensed under Apache 2

Autofac intends to be IoC with a C# 3.0 flavor, but also supports 2.0.

Unity Licensed as MS-PL

ObjectBuilder was formerly MSFT’s only public foray into DI/IoC

Puzzle.NFactory Part of the larger Puzzle Framework

Ninject formerly "Titan"

S2Container.NET on version 1.3.7. Port of Java’s Seasar2

PicoContainer.NET Port of Java’s PicoContainer

LinFu Licensed under Lesser GPL

Wow! I’m exhausted from just reading that list let alone trying to investigate each.

With the explosion of all of these frameworks and choices is .NET destined to become the next Java – overburdened by its complexity and just waiting for the next new kid on the block to win over developers with its simplicity?

Less is More

If only there was a web framework that told you which approach it preferred – an opinionated framework if you will. And what if that framework used sensible defaults and chose the “standard” ORM that works for 99% cases without any configuration or angle-bracket wrangling.

Isn’t that the allure of Ruby on Rails? It’s sooo shiny and sooo simple…

Lastfm for Ruby ruby

In fact, it’s been winning over .NET developers right and left. Can Microsoft stop the bleeding?

Microsoft to the Rescue?

Luckily Microsoft is not idly standing by. I was glad to see on a recent blog post from ScottGu that a core focus of upcoming .NET versions would be simplicity. They don’t want to lose those developers that are overwhelmed by the amount of options and they realize that too much configuration and too many options can actually be bad.

An excellent example, is the new Web.Config file in ASP.NET 4.0. In current versions of .NET, the Web.Config file is littered with years of accumulated settings involving: session state, ajax dll redirects, http headers, and authentication settings. In short, it’s a convoluted mess.

From ScottGu’s post, here’s what a new “clean” web.config file will look like:

web2

Now THAT’s what I’m talking about! I feel better already.

So, there is hope. We’ll see what other features VS2010 gives us and cross our fingers that they continue to give us “less” rather than “more”

Posted in Programming.

0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

Some HTML is OK

(required)

(required, but never shared)

or, reply to this post via trackback.