Use Vanilla Js

JavaScript community has had a lot of JavaScript framework leading to JavaScript fatigue. With each framework coming up every week. Saying it performs something better than the previous framework. Most developers tend spend most of their time learning all these frameworks just to make sure they stay “relevant” in the development community. And the time they spend on developing the actual project tends is very less an in the end it all ends up with dissatisfaction and feeling overwhelmed by all the noise so we have to learn to filter the noise or else it we be a slow descend into the madness.

The Problem

While all these frameworks are great they all have one inherent defect. They provide an abstraction over existing vanilla JavaScript so that you could certain things easily with minimal code since others some of them is “taken care for you”. And these abstraction always tend to be leaky. Meaning all these frameworks are designed to solve a particular problem in mind and are easy to do certain things easy in them without much code. But you will sometime hit the walls of this fishbowl and you might need to something that the framework was not designed in mind so you deploy certain hacks to overcome this and in the end they make your code more complex than it should be ( some time to do this hacks you need to know internal of the framework to do this which kind of breaks the purpose of this abstraction).

Thus when a new framework comes around that promises to solve this problem people tend to jump the boat only to later realize that they cant do something else in that and so does the descend into the spiral of madness continues.

So what to do about It

The solution to this is pretty simple don’t use frameworks rather pure Vanilla Js with some libraries ( like lodash, ramdajs, axios etc.. ) to solve the problems. Considering most modern browsers have large stable API you might not even need to use Jquery. The advantages of libraries over framework is that they just provide utilities that help you solve the problem rather than trying you to make you follow some steps so that the problem could be solved in a particular way. Thus you are free from the mortal bounds of this frameworks.

Don’t write frameworks

Another important thing is that you don’t need to write a complete new framework that is not what i’m talking about. If you have your application build as separate small reusable Lego bricks (modules) written in pure js with each of them designed to solve one particular problem in mind with controlled input and output with minimal side effects. Then your Application becomes more composable. so that later on you could throw out one of these modules when you don’t need that feature and replace that Lego brick with some new one so that it does something else different now. And each Lego brick ( module) is easy to test for defect and can be fixed with kragle if it is broken.

With Great power comes great responsibility

While using vanilla Js is great since it provides great flexibility it comes with a price you need to know good amount of Js to do useful stuff with it. This is a good thing because if you know good amount of Js and can build useful stuff with it. Then you can solve problems easily and you wont ever have the need to learn another new shiny framework. Thus it will free you and give you a peace of mind and you can spend all your focus in solving the real problem rather than solving the meta problem.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.