If I know vanilla Javascript do I need a js framework?

There are a lot of new trends and frameworks out there at the moment, but if I'm an expert with vanilla javascript do I need any of those out there?
Like Vue.js or AngularJs or React.

Did you find this post useful? Show some love!
DISCUSSION (1)

For people who are truly expert with JavaScript, they might not need a framework (or library, as some of them describe themselves...Vue and React). But "expert" is very open to interpretation and opinion, and many professional JavaScript developers are really good at some things, but maybe not so great at other aspects of writing code.

When you don't work with a framework or library, you are starting with a blank slate and need to figure out how you will do several things by yourself. This is fine, if one has the savvy and experience to do that. This ability is usually developed over years of creating web applications, where you/your team come up with patterns for doing things that these frameworks/libs (shall we call them 'F&Ls'?).

Examples would be:

  • How will you load data (a la an HTTP library, like jQuery's ajax() method or the more modern Axiois library?
  • How will you manage the DOM, adding/removing elements? These days the libraries are using a virtual DOM to abstract working in the DOM from you and result in speedier changes.
  • How will you manage state (data) and have the DOM/UI react to changes of it?
  • How will you re-use the same thing (a component) over and over again in multiple areas of your website/app?
  • Taking a big step forward here: do you need a significant build process with Gulp or Webpack to handle various things: package mgmt, code transpilation (ES6/7 to ES5), CSS preprocessing compiling, etc.? It's really hard to develop a thorough build process.
  • Certainly not last and not least is unit testing (just one of many forms of testing) - how will you handle that?

There are many smarter people that I would would have lots of things to add to this list, but the general point is that these are all patterns that F&Ls have existing capabilities to handle. Recreating these yourself, although possible, will take lots longer, require much more testing and updating, than relying on some vetted, mature functionality that already exists.

This is not to say that you can't do some things your own way with your own code AND also use some 3rd party code. I think that could be a fantastic way to go. But be very aware of what you are capable of developing from scratch, and know how to decide on some other library for that which you don't want to code yourself.

It should be said that even today there are some amazing people or teams that create amazing web apps with straight-ahead jQuery and utility libraries like underscore, and they didn't rely on the modern BigBoy F&Ls out there. But it's my bet that these teams are quite experiences with front-end and back-end architecture and design patterns.

I think a great exercise for somebody that is considering a new substantial web project is to list out the general features that they need that some of the modern F&Ls provide. Ask, "Do I need that?", "Can I create my own mini version of it without this F&L?"

If you can think of it, and say that you can A) account for it yourself and B) find some 3rd party library to account for what you don't want to code yourself, then you can do it; you can do a lot without a modern F/L. Just start out documenting what you want to do, and work on what you need, etc. in that document before you start anything...over the course of days and weeks you will find the "edges" of your knowledge and comfort and start to really see what you need for the features you want.

Classic DEV Post from Jun 7

10 Things I Regret About Node.js

Photo courtesy of flickr user Trygve Lie. The creator of Node JS, Ryan Dahl, r...

READ POST
Follow @nickytonline to see more of their posts in your feed.
ImNah
Member since Oct 2, 2017
Trending on dev.to
One year working remotely
#dev #remotework #coding #react
An Introduction To Using Gatsby Image & Gatsby.js V2
#react #gatsbyjs #javascript #graphql
What and How to Test with Jest and Enzyme. Full Instruction on React Components Testing
#frontend #react #javascript #jest
The web built by node and vue, imitate Twitter's UI and feature
#node #vue #jwt #mongoose
ESLint seems useless to me. Should I use it?
#javascript #eslint #beginners
Shipping React Native apps with Fastlane and Travis
#reactnative #fastlane #javascript
I’m Building A JS-Based Static Site Generator #WishMeLuck!
#javascript #staticsitegenerator #pug #sass
Demystifying Array.reduce(): How to understand it and when to use it in your code
#javascript #node #react #beginners