Programmers, the best of whom are pretty lazy folk (in a good way), got tired of having to write the same code over and over and over again just to cover the basic tasks that they wanted their applications to perform. So they batched that recycled code together and called it a framework.
In addition to preventing repetition, frameworks provide great organization. They tend to force you to organize your files and code in a way that keeps it highly modular and really clean. When you start a new app with any framework, you’re given dozens of folders already organized in a hierarchy which makes sense and follows good practice such as Model-View-Controller (MVC) separation principles. It’s not quite “color-by-numbers” for code, but it certainly keeps things ordered.
There are often several different popular frameworks for a given language. They can have exciting names like Ember, Meteor, Django, Rails, Grok, etc. Wikipedia has a comprehensive comparison of frameworks that should give you an appreciation of the number of them. For Ruby alone, though Rails is the most popular, there are also Sinatra and Padrino and more.
A final thing to note is about licensing – frameworks are typically (though not always) open-source and their license allows you to use them, modify them, make money off them, sell products with them, etc., all without owing any fees to their original creators. You may not think too much about that as you blithely code away using other people’s frameworks, but it’s a very important distinction between open-source frameworks and commercially produced/sold software. We’ll get more into Open Source Software (OSS) in later units.
Look through these now and then use them to test yourself after doing the assignment:
This section contains helpful links to other content. It isn’t required, so consider it supplemental.
This section contains questions for you to check your understanding of this lesson. If you’re having trouble answering the questions below on your own, review the material above to find the answer.