Hey folks, how are you doing? Good, I hope.
Today I’m going to talk about a polemic subject on JS community:
Frameworks… to use or not to use, that’s the question.
Introduction
If you’re not familiar with the term, in a nutshell, it can be said that a framework is a solution written to solve a generic problem. It’s also commonly related with libraries, since a framework can also be a library or a set of them.
In the Javascript universe there are a lot of these generic features, mostly of open source code, created by the community itself. And there is also a lot of discussion about whether or not to use these third party codes. This article is splitted in two parts, in the first I'll address some pros and cons on the subject and in the second I’ll bring a practical example on some points mentioned.
What is the right choice?
The first thing I would like to say is that there is not “right or wrong” about this subject, it’s a much more matter of “necessity and choose”. Therefore, it’s extremely necessary to know what kind of problem we’re trying to solve and in what context, to be able to choose the most appropriate solution. I’ll list some of the points that I consider the most important in both approaches.
Note: It’s worth mentioning that nothing written here it’s an absolute rule, but rather a set of opinions built according to my experiences and that may vary according to experiences of each one. It’s also necessary to understand that in most cases we’re talking about frameworks with a certain relevance, with good practices, organization, tests and good quality standards.
Strengths of using frameworks:
- It’s a solution used by a vast community, therefore, there are several people working to find resolutions of the same problem, which brings a collective view and different points of view.
- It’s a simpler abstraction to something that may not be important in the desired context. For example, it’s not necessary to know how all the gears in a car work to learn how to drive and get around more easily.
- Agility in development. It’s not a rule, but it’s usually is a gain, since abstractions decrease the complexity level of some solutions.
Weaknesses of using frameworks:
- Customization. As it’s a solution that aims to solve a specific type of problem, it may be that at some point you have a case that does not fit into it.
- Bugs. It may be that an update to the framework or a version change generates an unwanted bug in your code and you have no control over it to fix it.
- Dependency. Something very common is the development of a code be completely tied to a framework, creating a total dependency relationship. That is, if at any point the framework is discontinued or no longer maintained, this could became a big problem.
Strengths of not using frameworks:
- Greater control of the code. Since you’re going to develop everything using native technology, you have complete control over everything that has been built.
- Highly customizable solutions.
- Less overload. The fewer third-party modules you application has to load, it will be lighter and build more efficiently.
- Greater mastery of native technology.
Weaknesses of not using frameworks:
- Complexity. Sometimes, it may be complex and even unnecessary to create a solution from scratch for the whole problem.
- Standardization. When you work in a big team, depending on their experience and the size of the project, it may be hard to manage and maintain over time.
- Time. You’ll probably require more time developing some things that are already "done".
Conclusion
I, in particular, think that thousands of frameworks are one of the coolest things in the javascript universe. It gives me the feeling of working all the time with people around the world, in addition to having access to great solutions that I probably wouldn’t have the time and ability to develop on my own or in a lifetime. Still, now and then I'm in a situation where the best option is not to use it. For example, when there is really no framework that fully meets your needs or when for security reasons you choose not to carry sensitive information through third-party libs, or still because you cannot risk depend on an external lib, among others.
Taking into account all pros and cons raised for both hypotheses, it’s clear that it’s not a simple matter of “good or bad” or “like or dislike”, but of making the right choices within a given context. Therefore, it’s to take stock of the situation you’re in and the pros and cons of each approach to get the best possible solution.
Next steps
Although I think using frameworks are really positive in productivity terms, standardizing, reuse, among other advantages, there is something that I see on a daily basis that I consider a negative point. Some developers are totally oriented towards the use of frameworks, to the point of not knowing how some basic things of the technology work. Something I always defend is the good old "do the basics", to know well the concepts and main nuances of the language or technology with which you work. So, as i mentioned at the beginning, in part two of this article I’ll bring a very cool practical example on this topic, addressing one of the most used solutions in Node JS.
That’s it for now. And you, what do you think about the use of frameworks? Leave your opinions, experiences and feedbacks on comments.
May the force be with you, see you next time.
Top comments (0)