Why you should code in vanilla too
Tags: javascript, node, performance, code
Published: 2018-03-16 12:20:45

---
title: Why you should code in vanilla too
published: true
description: Why vanilla makes everything better, including your code.
tags: JavaScript, Node.js, Performance, Code
---

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](https://jquery.com/) 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](https://angularjs.org/).

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_](https://vuejs.org/): 58kb
[_Jquery_](https://jquery.com/) : 93kb
[_React_](https://reactjs.org/): 98kb
[_Angular 1.x_](https://angularjs.org/): 143kb
[_Ember_](https://www.emberjs.com/): 435kb
[_Angular 2_](https://angular.io/): 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](https://hackernoon.com/im-harvesting-credit-card-numbers-and-passwords-from-your-site-here-s-how-9a8cb347c5b5).

6. **Dive into server side**
With better understanding of the language you can easily work [node.js](https://nodejs.org/en/) (built on [v8](https://developers.google.com/v8/)) and can finally write your own backend.


This was originally published on [Medium](https://medium.com/@nendhruv/why-you-should-code-in-vanilla-too-e85baa076919)