You Don’t Need a JavaScript Framework
Do we suffer from JavaScript frameworks fatigue? Or are we ignoring the performance and data bundles of our users?
Let’s Go Back to the jQuery Era
Do you remember those days when everyone used jQuery for everything! jQuery before, jQuery after, everything smelled like jQuery. Every website or web application included jQuery.
Why_?_
Developers found Vanilla JavaScript was too difficult or complex to handle. There where a lot of big differences between browsers.
Thank God those days are over! jQuery fixed a big problem for the JavaScript community. But it made most of us lazy because we didn’t understand what was going on under the hood.
For me, it all ended when this website launched.
The JavaScript Fatigue Era
Right now, 2020 is just starting but we are making overweight websites and web applications. We can choose Angular, React, Vue.js, Svelte, or Polymer. Sorry, I won’t name all of them…
Maybe you’re thinking: “Well, go ahead and judge for yourself.” Well, that is also what I’m doing with this article. I’m very critical about my own JavaScript fatigue.
But let’s be honest. It has never been easier to start a website or web app from scratch with a single command. For Angular, we use ng new project name
, for React we use …
, etc.
Most of the time, we are picking what suits us the best. But we have to decrease our JavaScript weight some more and be more thoughtful on what we load into our application.
Because, maybe HTML, CSS, and JavaScript are enough.
When I talk about the JavaScript framework, I also mean the JavaScript library. Angular, React, Vue.js and Svelte are for me in this category. (Yes, there are a lot more…)
Pros and Cons of Using a JavaScript Framework
Using a JavaScript framework has some pros and cons. Because it’s about good and evil. It’s more like one’s better in one situation than the other.
I’m using Angular in my day job and like to experiment with React or Vue.js. Or trying some small JavaScript micro-library that does only one thing very well.
When You Shouldn’t Use a JavaScript Framework
There are a few situations I won’t recommend using a JavaScript framework, but rather recommend using a JavaScript micro-library or use Vanilla JavaScript.
- Your application is simple or small. If you’re building a small project, such as experimenting with a new JavaScript API.
- Tight on performance. When your application needs to be of very high performance, even on a low-bandwidth connection.
Every byte that is sent over the line counts. Then, it’s not smart to use a big framework. Because a JavaScript framework comes with a cost because of its overhead.
Well, there are many tools to make this more manageable. It’s better to prevent problems than to solve them.
When Would a JavaScript Framework Be a Smart Choice
There are situations where it is smart to use a JavaScript framework. But still, we need to be careful with everything.
1. Your application is big
When you’re building a big application, it could be smart to use a JavaScript framework. A framework, most of the time, comes with great support from a community.
Most of the time, a community will provide a lot of learning material that helps to build an application for long-term support.
2. You or the company values open source
The best thing about open source is that everyone can use it how they want (if the license allows it of course).
A lot of the elements of that framework are built by people that spent their free time on it. This doesn’t cost the developer or the company that is using it any money.
If a company/developer likes to contribute to a JavaScript framework, other people can benefit from that too.
3. High speed development for new features
Because most frameworks offer a lot of tools they make it easier for the developer to build new features in shorter times, they can rest on the shoulders of smart engineers that did a lot of testing for them.
Conclusion
In my story, I have more pros in comparison to cons when we talk about JavaScript frameworks. (If you have any additional ones, please add them in the comments!)
But even though it sounds so good to use a framework, we have to be very careful with what we load onto our websites and application.
Always ask the question: “Why do I need this framework? What benefit would we have from building it ourselves or using something that already exists?”
“What consequences does it have for the user? Is a low-end mobile phone also able to use the application with the same user-experience as a high-end mobile phone?”
Frameworkless Movement
If you like the idea of not using a framework or building stuff with Vanilla JavaScript I would recommend checking this Github repo with inspiration. I like the idea of FrameworklessMovement.org.
Thanks
Thanks for reading all this way! I hope that after reading this story you will be more careful picking a JavaScript framework, or not picking one.
Because, in the end, our goal should be building an application that has great user experience and is scalable.
If you have any questions, please let me know in the comments.
DevByRayRay is a JavaScript Developer who loves to share his knowledge. Ray is living in the Netherlands and is mainly posting stories about JavaScript, TypeScript Angular and anything related to life as a developer.
You can follow him on Twitter DevByRayRay or subscribe to his newsletter to be updated when there is a new post published.
Read More From Me
2 Ways to Resolve Duplication in JavaScript Arrays and Objects
_Do you know how to deal with duplication?_medium.com
What Is The Scope In JavaScript
_Explanation about the behavior of Var, Const, Let, Functions, Objects, and Classes in the Global Scope._itnext.io
Top 5 Favourite Medium JavaScript Posts
_My favorite posts of February 2020 about JavaScript Development_medium.com
Make Your JavaScript Objects More Predictable by Creating Maps
_No more undefined properties_medium.com
7 Steps to Dockerize Your Angular 9 App With Nginx
_Set up your Angular 9 app in a Docker environment and deploy it in no time_medium.com
Suggestions
5 Ways to Improve Your Coding Skills with ChatGPT: Tips and Tricks for Developers
Get better at coding with ChatGPT! This blog post provides five tips for using ChatGPT as your coding buddy, including spotting errors in code, brainstorming solutions to application problems, and improving code readability. Learn how ChatGPT can help you write better code and save time!
Revolutionize Your Programming with AI, ChatGPT & GitHub Copilot
Discover the top five benefits of incorporating AI into your work as a developer, use ChatGPT and Github Copilot. Don't get left behind – start using AI to revolutionize your programming skills today
Getting Started With Programming On A Budget
In this post, I want to share with you some tools you can use on a mobile phone or cheap tablet to get started with programming web development.