Using Frameworks to Build Websites and Web Applications
Posted April 26, 2014on:
Even if you only build websites using CMSs, you’ve probably heard the word “framework” before. You’ve probably also heard of a few famous web frameworks, including Ruby on Rails, Django and Bootstrap. Many experienced web developers build websites using frameworks and often find them easier and enjoyable to use.
In this article, we’re going to explain what a framework is, and when you might use a framework.
If you are currently doing one of the Coding Training classes, this information will prove especially useful to you. If you are just using a CMS, this post will still contain some valuable insights, as many CMS systems can and are built using frameworks. For example, Drupal 8 is currently being built on Symfony and Joomla 3 is using the CSS framework Bootstrap.
What is Framework?
The goal of a framework is to allow designers and developers to focus on building the unique features for their project, rather than re-inventing the wheel by coding common, familiar features found across many websites and web applications.
A framework can be considered a pre-built that handles most of the repetitive or common features. As a result, unlike a CMS, a framework will probably not have a template/structure user interface (although this is not always the case, as Django provides an administration interface). Most of the activity will be done by writing code and interacting with different parts of the framework itself through code.
Often frameworks take a while to learn, but once you’re familiar with them, they should speed up your development time.
5 advantages to using a framework:
- Open-source: Most of the popular frameworks in many languages are open-source (or available to use for free). They also come with licensing that isn’t restrictive and allows you to build commercial products using such frameworks
- Documentation and support: Although this can vary (if the language being used is popular and the framework has a lot of developers using it), you can expect that the framework will either have good documentation, good support or both at the same time. It is worth mentioning that “good support” is a subjective issue at times. Typically, paid support will almost always be faster and more concise, but this also depends on the level of activity within the framework – as a framework like Ruby on Rails demonstrates with a massive community, which is renowned for its welcoming nature and good support too.
- Efficiency: This could be considered the most vital reason why frameworks exist. They eliminate the need to write a lot of repetitive code that you will find being used in many different applications. These include, for example, user-authentication and commenting systems. On average (if you have sufficient knowledge using a certain framework) you can expect to build a project in much less time than would be achieved writing code without a framework
- Security: Typically, a framework is developed and tested by many different developers. It is extremely likely that many security risks are addressed and tested when the framework is being built. New security risks can also be addressed and fixed quickly. However, security can also be considered a con, as will be mentioned in that section
- Integration: If you are building almost any type of application (including a website) and you want to store some data, you will typically use a database. Just like a database, there also exists many other tools that link to web development. Many frameworks will thus make it easier to link to these tools and also communicate with them (for example, when “talking to” a database is abstracted away in a certain framework, making communication with the database much easier)
5 disadvantages to using a framework:
- Limitations: Generally, you will not be able to do almost anything with a single framework. They are all restricted in some way, from coding paradigms to database designs and everything in between. A good way to work around this is to see what the framework is being used for by other developers in the community, as this will give you an idea of what you can achieve
- Learning bias: If you decide to learn how to use any framework from some programming language you are familiar with, chances are that what you learn will be somewhat different to the language itself. This is due to the fact that a lot of those repetitive tasks have been created in custom functions and other parts, which is why you will learn such things that may not have existed in the language lessons itself. Apart from that, you may also learn a lot of things that may be irrelevant to you whilst using the framework in real-life, but are necessary to grasp how the framework works
- Steep learning curve: Although this isn’t always the case, most frameworks can be difficult to learn and even more difficult to master. After some simple research into this matter, a university professor said that it will take about 2 years (with no programming background) to become familiar and comfortable using a language (Ruby) combined with a framework (Rails). This may not be the case when being self-taught or having years of programming experience, but I would say that even with experience, at least 3-6 months will be needed to become confident using any framework (based on continuous learning and practice)
- Cost: Frameworks require more development expertise and experience than most CMSs. As a result, it can be more costly to hire reliable framework developers than reliable CMS developers. As the experience shows, the average project built with a framework is more expensive than a similar project built with a CMS.
Examples of popular frameworks
Below are some popular web frameworks (in no particular order) for different web languages. This is not an extensive list, as there exists many more options out there.
Over to you?
Have you built any websites using a framework instead of a CMS?
What were the advantages and disadvantages of going with a framework?
Share your feedback or any other experiences below.