Vanilla JavaScript vs JavaScript Frameworks
One of the things one learns when starting web development is the 3 tech stacks i.e HTML, CSS and JavaScript. While HTML provides the bones and CSS the beauty, JavaScript provides the functionality. This has made this language to be one of the most used languages if not the most.
![]() | |||||||
| HTML, JavaScript and CSS |
My Background in JavaScript
First starting to learn programming, JavaScript was among one of the first languages that I learnt. Learning JavaScript brought a sense of accomplishment, as it was the first language that I learnt that I could see visually from the browser the effects of my code. This was virtually opposite to the console dependent C/C++, python and Java. Don't get me wrong, all the above languages have ways to implement graphical user interface, but none comes close to the ease of running your code and seeing the browser react to the events especially for a newbie to programming.
![]() |
| Vanilla JavaScript Code block |
When I later started learning a web framework, react, it was hard for me to start as I had not really had stayed for long not doing vanilla JavaScript and I quit several times and started again. I retrospect I wanted quick results and not to learn the framework really. The reason why I started with react was that it was the most popular.
![]() |
| React Code Block |
When I decided to learn react for the last time, I came across an blog that advised one to have a prior knowledge in vanilla JavaScript before trying react. This proved to be a a good decision as it was easier.
What I learnt so far
Having knowledge in both vanilla JavaScript and a framework makes your work as a programmer easier. This weekend I decided to updated some of my GitHub repositories. Since I had learnt Typescript, I decided to make them Typescript. The link for the repo with the is https://github.com/blackwakhu/career_picker.git and for the one with react https://github.com/blackwakhu/career-picker-react.git. It was a great exercise taking a previously forgotten code that formed one of my first attempts at programming and updating it to keep up with my current programming level. The findings were below
- Code length: When using vanilla JavaScript I tended to use more code to just perform some functions and this resulted me having to keep up with the all the classes and id in the HTML file. For react I used less.
- Time spent setting up the environment: For someone like me who is rarely close to the internet it takes me some considerable time to set up a react environment especially since when I am close to the internet it is always disappointingly found at low speeds making me prefer vanilla JavaScript.
- Ease of use: It was easier to use react as the code was shorter and straight forward.
- Popularity: Normal vanilla JavaScript does not enjoy the popularity of its constituent frameworks. This in turn has adverse effects on learning vanilla JavaScript as for most job offers, when asking for a JavaScript developer they usually include a master in the frameworks.
- Personal preferences: For most people, working with frameworks is the best as it is the current trend. This is because they feel they work less using a framework than when using the language itself.
- Customisation: While vanilla JavaScript has the problem of producing more code it makes it makes up for it by giving the user all the necessary tools to customize their code to their liking. This is something which is harder in frameworks as they provide template solutions view more packages to install.
- Learning curve: It is easier to learn vanilla JavaScript as compared to a framework. I learnt this the hard way
While a frame work will surely make your work easier, it is important to consider learning the language to give you more insights and appreciate some of the abstraction a modern day framework has.



Comments
Post a Comment