What is a framework?

The idea behind a framework is to offer a design you can use across multiple applications. All applications have a number of basic things in common. A framework is designed to provide a structure for those common elements (database interaction, presentation layer, application logic) so you spend less time writing up database interface code or presentation-layer interfaces and more time writing the application itself. The architecture represented by breaking an application up in this fashion is referred to as Model-View-Controller (MVC). Model refers to your data, View to your presentation layer, and Controller refers to the application or business logic.

-IBM

In general, a framework is a defined set of libraries, classes or structure which provides the foundation for a software development project. The purpose of a framework is to provide both usability and consistency between projects. It is almost always more efficient to use a framework geared for your specific task than writing the entire code yourself. Popular frameworks include Ruby on Rails (ruby), Apache Struts (java) and TurboGears (python).

The benefit of using a framework is to handle the more tedious programming tasks. Additionally, structure based frameworks provide a consistent and organized manner for more elegant development. This means that anyone familiar with the framework could look at another project written with the same framework and be able to navigate the code easily.