Vanilla JS or Framework?
Tags: javascript, react, angular, vue
Published: 2020-04-19 10:49:20

This question keep popping up in the mind of almost every front end or fullstack developers especially the startup ones.They will be like which one should i go for? vanilla js or framework? vanilla js is when you're writing pure javascript for example:
const trigger = document.querySelector('.element'); 
trigger.addEventListener('click', (e)=>{
/* some code here */
}
The thing is using a framework might not be the best option for a beginner, if you are just starting as a developer, starting from vanilla js will be a great one for you because when you jump straight to framework there are some things working in there you won't have the idea of how it works or the logic behind it plus you're going to find it difficult to tie your head around it.now lets highlight the advantage and disadvantage of using both..
1. Vanilla js (advantage)
![js](https://www.bitdegree.org/tutorials/wp-content/uploads/2018/12/node-js-interview-questions-logo-2-266x300.png)

* The beauty of knowing vanilla js is that you can learn any web framework eg react, angular, vue, backbone and so on,just name the framework you will be able to pick up anyone of them and do something with it as quick as possible.
* Using vanilla js for your app will put your mind at rest because your app won't depend on crazy quick changing js ecosystem.
1. Vanilla js (disadvantage)
* The only disadvantage we have with vanilla js is the limited time we have to start writing our code from scratch.imagine before you start writing const div = document.getElementById('element'); and so on before you achieve a click event, it somehow terrible and time consuming.

![js-cofee](https://images.squarespace-cdn.com/content/v1/58d20c79725e25b221549193/1521098258210-W9FBV72SMJJX3LESUA7Z/ke17ZwdGBToddI8pDm48kNvT88LknE-K9M4pGNO0Iqd7gQa3H78H3Y0txjaiv_0fDoOvxcdMmMKkDsyUqMSsMWxHk725yiiHCCLfrh8O1z5QPOohDIaIeljMHgDF5CVlOqpeNLcJ80NK65_fV7S1USOFn4xF8vTWDNAUBm5ducQhX-V3oVjSmr829Rco4W2Uo49ZdOtO_QXox0_W7i2zEA/js.jpg?format=2500w)

2. Framework (advantage)
* The pretty advantage of choosing a framework is that there is ease of time in doing a lot of things.
* It has a lot of pretty predefine functions you can use without you have to write 50 lines of js.
![react](https://hackernoon.com/drafts/otda32fo.png)

![angular](https://cdn.searchenginejournal.com/wp-content/uploads/2019/04/the-seo-guide-to-angular-1520x800.png)

![vue](https://miro.medium.com/max/3920/1*oZqGznbYXJfBlvGp5gQlYQ.jpeg)

2. Framweork (disadvantage)
* Some framework is very bulky when it comes to functions with large set of powerful features and codebase e.g angular
* Knowing framework without you have the in depth knowledge of vanilla js might not be a good one for you because some things will be working be like magic to you.

So if you are just starting as a developer, i will advice you start from vanilla js then once you're very comfortable with vanillaJs, pick up any framework of your choice and learn it with ease.

if you have any addition or substraction do not hesitate to share them in the comment box below...
![Thanks for reading...](https://cdn.clipart.email/9122c9d6213db078f25a6a1116ae7e6d_dd-animated-thank-you-image-thank-you-for-your-attention-clipart-_408-251.gif)