- You need to write more
- High performance, since they're native functionalities.
- Is not significantly less readable than the structure of a framework.
You shouldn't believe neither that a framework will be always the best, a framework is neither the absolute truth
- In most of the cases, the frameworks gives you cross browser support.
Like anything else in the development, this is a matter of experience. Let's answer this question with more questions !
You choose a framework simply because you write less or ?
// Vanilla JS var element = document.getElementById('item'); // jQuery var jElement = $('#item');
Worth sacrificing speed for readability ?
However, readability with most of the actual frameworks is more important than the performance (in comparation with vanillaJS), so the question to solve this doubt is, is my project big enough to care for this performance numbers ? Without this benchmarks and testing by yourself playing with the application, you shouldn't notice big difference, that's the awesome human eye.
The wheel already exists, why reinvent it ?
var element = document.getElementById("something"); var jElement = $('#something'); // Removing a class with jQuery jElement.removeClass('myclass'); // Removing a class with VanillaJS element.className = element.className.replace( new Regexp("(?:^|\\s+)"+myclass+"(?:\\s+|$)",'g'), '' );
What do you choose ? I vote for the jQuery solution, do you? If you work in a company, you don't have such time to create your own library (unless you do it in your free time and share it for free with your team) because that's very unproductive and you can get fired (in worst of the cases), you need to provide a solution for the client using simple and quick solutions that will help you to work faster to satisfy your boss and the client.
var element = document.getElementById("something"); var jElement = $('#something'); //id with jQuery console.log(jElement.attr('id')); //id with vanillaJS console.log(element.id);
In this balance there's no advantage,everything is like the chess, you must think through every movement and take the right decision at the right time.
I’m not saying you should never use a framework, because you shouldn't underestimate the enormous development effort and assistance that the libraries provides you.Be very conscious of what each framework does, when to use which feature, it’s pros and cons, how maintainable is the written code,how's it performance and how moves in different devices.
If you have another point of view, please let us know in the box comment down here.