Archive for August, 2007

Define “Framework”

Many people wonder what a framework is. Many people work with people who work with a framework, and yet these people just pretend to know what this is about.

The problem is, not only the concept of framework is not immediately understandable, but also that most of the explanations of the term “Framework” suck.

How they define it

Take the most famous framework, Ruby on Rails. They don’t bother to define what a framework is. People coming to Rails either already know what this is all about, or think that this is something important because Rails is famous.

The Django framework proposes this definition:

A high-level Web framework is software that eases the pain of building dynamic Web sites. It abstracts common problems of Web development and provides shortcuts for frequent programming tasks.

They complement this definition with a page-long list of the Django features. That’s the same approach as Rails: Understand what our framework does, you will understand what a framework is in general. Kind of biaised.

Wikipedia tries to be more specific and says:

A software framework is a reusable design for a software system (or subsystem). This is expressed as a set of abstract classes and the way their instances collaborate for a specific type of software.

That’s too many words. 9 out of 10 IT managers jumped to the .Net platform before reading the second sentence (and therefore misunderstood the true nature of a framework). Besides, it doesn’t explain what a framework does for you.

Let’s see how symfony defines frameworks:

A framework streamlines application development by automating many of the patterns employed for a given purpose. A framework also adds structure to the code, prompting the developer to write better, more readable, and more maintainable code. Ultimately, a framework makes programming easier, since it packages complex operations into simple statements.

Although this sentence was written by me, it is not much better than the former ones.

Framework newbies are still wondering whether a framework is good, if they can use it to go shopping, if it enhances the sexual activity, and if it is something convenient to talk about during lunch.

Enter geeks

One of the reasons why the concept of framework is not that easy to make clear is that it’s a geek matter. Frameworks are used by programmers who develop enough applications to become unsatisfied with a language alone.

These people are interested in stuff like design patterns, test-driven development, object-relational mapping, and other dirty words. They just don't speak the same language as you do. And try to get an astrophysicist talk clearly about Strings Theory. Very few people know enough about a subject to be able to explain it, and unfortunately these people often don’t know enough people who don’t know anything about this subject, so they are not used to making it accessible.

Let’s try

Now let’s try it ourselves. The idea is to define the term “Framework” in a single sentence, and to check that anybody with minimum knowledge of web applications can understand it.

“If god had a framework, he would build the world in 3 days.”

All right, marketing boy, this may make your girlfriend laugh, but it’s not going to help us a lot.

“Frameworks are a supplementary layer on top of a programming language that make development faster and more productive”.

So this is something interesting for programmers, but what if I am a manager with three alternatives for a new website, built with either the ezPublish CMS, or the symfony framework, or the BEA Weblogic application server?

if($framework)
{
  Just::do($it);
}
else
{
  $it = strstr(fibonacci(75 * _SERVER['foo'])), strbin2hex('1101'));
  sort($it);
  if($it instanceof Crap)
  {
    thrown new CrapException('bummer!');
  }
  else
  {
    try_again();
  }
}


Hey spaghetti code man, I guess you learnt PHP development by hacking Wordpress and Gallery, didn’t you? Thanks, but you're not helping.

I can’t do this. Can you?

I guess I failed. Defining the word “Framework” in a single and simple sentence is just too hard for me tonight.

My only hope is that, as often in the web 2.0, the true value of this post will come from its comments, rather than from its body. Please help me: How would you define “Framework”?

Changes

When a moment of your life sounds like a David Bowie song, things often go well.

I'm leaving Sensio for a start-up company for which I will become the IT chief executive. That's a great opportunity and a thrilling adventure. For the symfony users who read this, be reassured: That doesn't mean that I will be leaving the symfony project. I have invested a lot in it and I strongly believe that symfony has a bright future; I want to go on contributing during some of my free time. I would like to go on writing plugins, or documentation, or giving talks and conferences about it. Besides, Fabien and I are still in good terms, despite my quitting his company, and he offered me to continue having a special role in the project. Lastly, my new company is building a very large website entirely with symfony, and I will have many opportunities to donate some code and documentation to the community.

There is a second important change in my life: I'm going to have a baby. In less than a month, if everyhing goes well, I will sleep much less and become a happy zombie.

So you can expect a little slowdown in my contributions until at least Christmas. But keep reading, I still want to redo the web...