What is a Framework Anyway?

January 6th, 2008

Ruby on RailsCakePHPFlex
There are some things that I’ve learned along the way, and to be honest I’m embarrassed that I learned them so late in the game. For instance, just this week I learned what unit testing is – it’s kind of cool incidentally. But, one of those things that confused me for a while was the concept of what a “framework” was. I knew about languages, obviously, but I didn’t understand where frameworks fit into the picture. Was it a special kind of language? Was a framework just a skeleton directory structure? For those that are experience, these are dumb questions. But I feel as though there are no dumb questions, and if I stumbled with it then someone else might as well.

So, to answer the question, a framework is simply a structured way of writing in a programming language. Let’s take Ruby on Rails for example. The programming language is Ruby – you can’t program in “Rails”. You could use Ruby and create files and classes one at a time and make your application that way, but frameworks can help out here. If you’re creating something that’s been encountered and created time and time again, there’s a good chance there’s a framework for it to help speed development along in a clean way. Rails does that. Want to set up a blog? Piece of cake. A shopping cart? No problem. How about an mp3 player? Eh, not so much. You know what’s a good framework for that? Flex. Flex uses a specific XML syntax in combination with Actionscript 3 to quickly churn out some standard Rich Internet Applications.

I’m not sure if I’ve lost anyone yet, but things like Flex, Rails and CakePHP are all frameworks – not programming languages. Each framework uses a specific programming language that’s best suited for the tasks at hand, but a framework is just a conveniently setup structure of files, methods, etc. to aid in development, and if the shoe fits it can really help speed up development time.

Leave a Reply

You must be logged in to post a comment.