-
Notifications
You must be signed in to change notification settings - Fork 0
Frameworks
Before we can start working with a framework, it is important to know what frameworks actually are.
To explain what a framework is, Scott Morris in this article wrote a good metaphor to explain what frameworks do in JavaScript. He wrote that coding in frameworks can be compared to building a house:
When you start building a house, you can do this in two ways. In the first way you can make the building material yourself by, for example, cutting down a tree and sawing it so that you have planks of wood. But this would not be efficient with such a large project as building a house. The second way is to go to the store and just buy all the pre-made materials (like the wood, stones, etc.). This is exactly the idea of frameworks in JavaScript.
Frameworks are collections of JavaScript code libraries that provide front-end developers with pre-written JavaScript code to use for routine programming features.
So frameworks are pieces of structured code libraries that ensure that developers can start new projects faster and more easily and maintain existing projects more easily. But this does not mean that using a framework is necessary for every project. Frameworks are generally more useful for larger projects such as websites with hundreds of subpages.
Despite the fact that this concept is fairly clear, in practice it appears to be more difficult to say exactly what a framework is. This mainly has to do with libraries that have framework functionalities and vice versa.
JavaScript has many frameworks. This is partly because you could also write a framework yourself. Yet there are some that are the best known and also the most used. The most famous are React, Angular and Vue Source. As an assignment for De Volkskrant, a choice could mainly be made from the frameworks React, Vue, Svelte. I will briefly tell you something about this per framework / library and list the pros and cons.
React was developed by a small group that works fulltime at Facebook. Today there are also many contributors around the world. They describe React as a library for building User Interfaces (Source, Source). So actually React is a library and not a framework.
React is component based. This means that it can merge components (small isolated pieces of code) to create a complex User Interface. As a developer, you can use this in two ways: By using the class component or the hook component Source.
- Large community, so useful for fixing errors
©️ Veerle Prins, 2020.