When a JavaScript framework is not needed


Photos - Maria Teneva , playground Unsplash

Sometimes React, Angular, Vue.js etc. -.. It's too much

Is it true that JavaScript-frameworks too much choice is too complicated? Or maybe we just forgot about performance considerations and that users should ultimately pay for the extra traffic?

Back to the jQuery era


Remember, there was a time when jQuery was used for everything! JQuery then, jQuery sho is the light jQuery flavor everywhere. On any website and in every web application - jQuery.

What is the reason for the popularity of this library?

Simple JavaScript seemed too complicated to use. In addition, there were many differences between browsers.

But salvation came - the jQuery library saved the JavaScript community from this headache. True, most of us became lazy as a result, because we no longer understand what is happening “under the hood”.

I saw when this site appeared .


An era of overly wide choice in the JavaScript world


2020 begins, and our sites and web applications definitely have "overweight." At our services are Angular, React, Vue.js, Svelte , Polymer (and this is far from all) - but the need to constantly make a choice in the rapidly growing framework zoo is tiring.

You might think, "Speak better for yourself." But that’s exactly what I’m doing now: I critically evaluate my own “fatigue” from abundance in the JavaScript world.

To be honest: it has never been so easy to make a website or web application. One command is enough today: ng new
in Angular, in the case of React, etc.

In most cases, we choose what works best. However, at the same time, you need to reduce the amount of JavaScript code and pay more attention to what is loaded into the application.

Because - what if a combination of HTML, CSS and JavaScript is enough?

And speaking of JavaScript frameworks, I also mean JavaScript libraries: Angular , React , Vue.js and Svelte  - all this together (and much more).

Pros and cons of using JavaScript frameworks


There are pros and cons to using a JavaScript framework. And the point here is not about good and bad frameworks, but about which of them show themselves better in which situations.

In my main work, I use Angular, but I like to experiment with React and Vue.js, and sometimes I try some small JavaScript micro-library that does one thing, but it’s very good.

When to use a JavaScript framework is not necessary


There are several situations in which, instead of a JavaScript framework, I recommend using a micro library or simple JavaScript.

  1. Your application is simple or small. For example, you have a small project, like some kind of experiment with the new JavaScript API.
  2. High performance requirements - if the application must be high-performance even with a poor Internet connection.

If every byte transferred over the network is counted, then using a large framework is not the most reasonable solution: you have to pay too much code for the convenience of the JavaScript framework.

There are many tools that help in such situations. But it’s better to prevent a problem than to solve it.

When a JavaScript framework is a smart choice


Often the use of a JavaScript framework will be justified - but even in these cases, you should not lose your vigilance.

1. You have a great application


If you are developing a large application, using a JavaScript framework may be a smart choice, as in most cases you will have good community support.

You will usually have a lot of reference material to help provide long-term support for the application.

2. You (or company) value open source


The best thing about open source is that it can be freely used (under a license, of course).

Many elements of such frameworks are developed in their free time from the main work - therefore, nothing needs to be paid for its use.

And if you want to contribute to the open JavaScript framework, it will benefit others.

3. Fast development of new features


Most frameworks have many tools that allow you to quickly implement new functions: a developer can rely on the experience of knowledgeable professionals who have tested the code well instead.

Conclusion


In this article, there are more advantages to using JavaScript frameworks than disadvantages. (If you have something to add - share in the comments!)

But even if the use of the framework sounds attractive, you need to carefully monitor what we upload to our websites and applications under development.

Always ask yourself: “Is this framework needed here?” Maybe it's better to do it yourself or use something ready-made? ”

“How will the application of the framework affect users? Will the application on a low-performance phone be as convenient to use as on the flagship device? ”

All Articles