Fighting the Framework

As I’ve mentioned previously, I’m someone who likes his code logical and tidy. While I’m just as guilty of playing the F5 game (a.k.a. “try it and see”) as any other developer, it really bothers me when I write code I don’t understand. I’ll spend hours researching a handful of lines of code in a sample posted on someone’s blog. I like to think that it makes me a better programmer. After all, I’ll be in a much better position if I have to write something similar in the future, or to troubleshoot any bugs that appear. And those pesky bugs love hiding in the dark corners of your code.

But that habit of mine can also lead me down some rabbit holes. I’ve given a name to one hole I tumble into on a regular basis. I call it “Fighting the Framework.”

First, a definition. Fighting the Framework occurs whenever you, the programmer, begin second-guessing the code library, development environment, or other tool designed to make your life easier. This second-guessing might happen because you’re convinced that the framework is too heavy, carrying unnecessary baggage when you only need a few lines to handle a particular case. It could happen because the style or idiom of the language is unfamiliar to you. It might be because the framework gets between you and the metal, forcing you to deal with high-level abstractions when you already understand the fundamentals. Whatever the reason, when you’re Fighting the Framework, you’re doing the programming equivalent of swimming upstream. The flow is against you. Everything seems harder than it should.

It’s at this point that I’ll waste hours of time researching alternate frameworks, refactoring already working code, staring off into space, or reading Slashdot. When you see a programmer doing things like this, it’s the equivalent of a child pushing peas around on the dinner plate, trying to find a configuration that tastes better.

Eventually, you just have to accept the fact that every possible configuration of peas on the plate will taste exactly the same — ick — and eat them. Don’t fight the framework. You picked it for a reason. It’s good for you. Perhaps even character building.

Pros and Cons

I’m in exactly this position with Microsoft .NET right now. Gordon and I picked the Microsoft platform for two solid business reasons:

  1. Our application targets knowledge workers, and most businesses run Microsoft Office.
  2. Both Gordon and I have prior experience working with C#.

At the same time, our choice of platform comes with some hefty drawbacks.

  1. All the cool kids are using Ruby or Python or PHP. How can we call ourselves a “2.0″ company if we’re using the platform that all but defines the 1.0 approach?
  2. Much of the innovation that’s happening in the software space is not happening on the .NET framework — something that Microsoft has belatedly realized. That means we often have to choose between using ports of software written for another technology stack or rolling our own libraries.
  3. We have to deal with certain Microsoft biases when it comes to application setup and deployment. (This wouldn’t be a major issue if our product weren’t so idiosyncratic. But hey, if we weren’t doing something dramatically different, we wouldn’t have set out to do it as a small ISV.)

Deciding what technologies to use in your product is hard. ReadWriteWeb lists five things to consider when picking a platform. Eric Sink provides guidance about building on solid foundations. Yet despite all the great advice, it isn’t easy to settle on one or two core providers. Especially when you feel you have to accept their entire programming paradigm, warts and all.

Spinning My Wheels

In the last two weeks, I’ve dealt with no fewer than three different .NET namespaces that have come up short. I could write several blog articles about what was missing — and probably will at some point — but right now I’ve got to stop dreaming of Rails, Adobe Air, or Google Gears. It’s time to take my own advice: Dean, the grass may be greener on the other side, but for now you’ve still got to mow your patch.

Don’t fight the framework.

3 Comments so far »

  1. Building Community the Hard Way « Infovark said,

    Wrote on May 6, 2008 @ 3:07 pm

    [...] long as I’m picking on Microsoft for releasing developer tools before they’re fully baked — a cornerstone of Microsoft [...]

  2. Ron Jacobs said,

    Wrote on May 18, 2008 @ 8:12 pm

    3 months ago I knew little or nothing about REST in .NET and when I got the assignment of figuring out how to build RESTful services with .NET I have to say I felt much of the same feelings that you did. Was it frustrating to fight with the framework? Yes indeed it was, but soon I figured out how things worked and now I feel much better.

    The good news is that the WCF team is most definitely working on improving the experience. In fact we are having some meetings on this next week so if you have any ideas, please let us know.

  3. Dean said,

    Wrote on May 25, 2008 @ 7:21 pm

    Though my comments about Fighting the Framework included my current frustration with C#, it’s a problem endemic to programming. Jon Skeet, author of C# in Depth, wrote about the phenomenon in a recent blog post about programming languages.

Comment RSS · TrackBack URI

Leave a Comment

Name: (Required)

E-mail: (Required)

Website:

Comment: