Why you should code in vanilla too

Dhruv Nenwani
2 min readMar 16, 2018

--

In the past few years I’ve become the guy who likes vanilla everywhere, ice cream, shakes, cakes or code.

Just like almost (everyone) I started out building websites with jquery because it was comparatively easy to grasp/understand and involved less code to write. Then there was the angular boom and I started building projects on AngularJS.

Even though I used to write vanilla javascript here and then but as my projects grew bigger the bugs became difficult to understand.

Yes frameworks will help you build things faster. Yes frameworks are here to make things easier. But as your project grows there comes a time when you know there is something wrong but do not why. Frameworks are built to solve specific types of problems and hence we have different frameworks to solve different types of problems. And as your project grows you’ll have different use cases and different problems, and I guarantee you all the time you saved by using a framework will be lost to solving a bug that you have no idea about.

Now I’ll tell you why you should write more and difficult (not) code.

  1. Lightweight Applications

Adding any dependency automatically increases your app size, more http requests and more load time.
File size (minified)for the most used JavaScript libraries/frameworks:
Vue: 58kb
Jquery : 93kb
React: 98kb
Angular 1.x: 143kb
Ember: 435kb
Angular 2: 566kb

2. No Dependency

You own your project completely. You know your project in and out. If there is a bug/feature request that you need then you don’t have to wait and hope for the next version of your library/framework or worse add an an extra dependency to get things done.

3. Learn New Things

When you do not have any abstract layer you tend to explore and learn new things. You’ll look for solutions that the language provides and you’ll get to know the hidden gems of JavaScript. Your understanding of the language becomes better and obviously you understand your project better.

4. Contributing to open source

All (Mostly) libraries you use are written in vanilla JS. Since now you have a better understanding of JavaScript you can quickly understand the big codebase of any library and contribute to them.

5. Better security

Yes you read this right. By using libraries you might be making your website more vulnerable or might be risking your user data. There is a chance some external dependency is taking your user data and sending it to their servers. For more details read this post.

6. Dive into server side

With better understanding of the language you can easily work node.js (built on v8) and can finally write your own backend.

--

--