6 September 2006
Any Problem in Computer Science Can Be Solved with Another Layer of Indirection
I spent a portion of Labor Day weekend working on new controls for Fortitude Forms. But reflecting back on it now, two things have shocked me: How easy it is to write controls, and how many layers of indirection Fortitude Forms has.
I have always argued against steep initial learning curves. The payoff has to be very high to make even a moderate learning curve worth pursuing. But reflecting back on this weekend, its surprising just how quickly complexity can arise. The advantage of using managed forms is that validation becomes trivial. A form submission becomes an atomic action, independent of any actual logic. A few lines of glue code is an action, but has no additional goals is has to abandon. This makes complex forms with variable numbers of fields or special cases like file uploaders much easier to handle, as a layer of indirection separates developers from users working forms and instead presents them with a complete form.
Prado, ASP.net and Fortitude Forms all do this. However, ASP.net’s framework is a part of ASP.net. It’s a black box and developers must accept that it is there and it works. Visual Studio aids in this, by making so many details of the form automatic. Prado and Fortitude Forms both lack this ability. In either, curious developers can burrow through each respective framework’s code, unraveling each ensuing layer until finally, the physical layer is exposed. Many open source developers consider this an advantage. Though I don’t consider myself an open source developer, I consider it a liability.
Most programmers have large egos. When developing, we generally don’t like to consider something is wrong with our code. With a black box, it doesn’t matter. Even if their code is broke, developers must still code around it. But with open frameworks, nothing prevents a proud developer from delving through layer upon layer of delivered code, looking for the one missing function call which would fix everything. But frameworks generally aren’t small things. Supposing there are 5000 lines of code comprising the framework, a sufficiently large program may require a week of debugging when descending into source.
When everything works properly, a framework accomplishes its goal of accelerating and managing development. The more advanced the framework, the faster it will accelerate. But the corollary is also true: The more advanced the framework, the longer it takes to become comfortable with and the more suspicious developers are that it doesn’t work properly. For this reason, ASP.net has the blackest of black boxes and is therefore the pinnacle of indirected development on the web.

