I do not understand how can a framework help me, when it seems to me that almost everything I try to achieve in a framework can simply be done in jquery with few lines of code, like calling a rest service with Ajax and then outputting the result

There are two main questions you should ask yourself when making the decision to use jQuery or not in a project.

1. How comfortable are you with frontend technologies?

Are you just starting out in the world of frontend and still wrapping your head aound the DOM and JavaScript?

If yes, just use jQuery for now. It’s important to understand the fundamentals of HTML, CSS and JavaScript before you move to frameworks, since many times they come with a lot of magic out of box, which might be confusing if you’re just starting out.

Are you an experienced dev and just don’t feel like learning a whole new framework for a simple frontend?

Then you might be missing out. Even if you’ve used only jQuery until now because it was the only thing you knew, a minimalistic frontend framework like Vue.js or plain React might make you waay more productive. This 10 minute video on Vue.js should spark your curiosity :)

2. What are you trying to build?

Do you just want to load some data from a server and display it on a page?

Use whatever you are most familiar with. If you only know jQuery, it’s fine to just use it for now.

Do you want to have the screen update based on user interaction? Are you reading data from the HTML elements in order to send it back to the server?

If you need to keep data from the sever in sync with the DOM or the other way around, the code will start to get out of hand pretty fast. So it’s ok to start with jQuery, but as soon as you see you have to write a lot of custom code just to update the screen maybe you should consider a minimalistic frontend framework like Vue.js or plain React.

Are you planning to maintain the code for a longer period of time or is it just a one-off frontend?

If you will want to maintain the code in the future and build upon it, then it might be worth it to consider a minimalistic framework like Vue.js or plain React.

Are you planning to build a complex frontend application with multiple pages? Will there be more than one person working on the application?

In this case you should definitely pick a framework! You’ll want to look at full featured frameworks, like AngularJS or React + Redux. For even more frameworks to choose from, take a look at Stackshare MVC frameworks and Stackshare UI libraries.

Conclusion

Always use the right tool for the right job and don’t be afraid to try something new.

Is there some other situation you find yourself in? Let me know in the comments below!

Comments