DEV Community

Discussion on: Should I use frameworks or libraries such as Angular, React, or VueJS or not?

Collapse
 
leightondarkins profile image
Leighton Darkins

This question is difficult to answer without some context about what your application is.

In general, my rule is to start with the smallest toolset, that doesn't hurt to use. So my first recommendation is to ask yourself: What's your motivation to change? Is your codebase difficult to work with? Is the app hard to test? Is it slow?

If it's a Todo App, that doesn't do much of anything and doesn't exist in a broader ecosystem of applications. Then employing a "heavy" JS framework would make very little sense. You'd stand to gain very little outside of learning a new skill, which can be valuable in its own right.

But don't be fooled into believing that great web apps need to be written with big frameworks. There are plenty of great examples of apps and teams that work wonderfully with just plain ol' Javascript.

As a way forward, and as a general recommendation: I'd pick a single component in your existing app, even just a button or a text input. Create a branch, then replace that single component with a new one built in Angular. Then do the same with React. And again with Vue. Bear in mind that this may mean wrapping your entire existing application in some kind of monster component, but we're experimenting, so it's a-ok.

This will immediately give you a taste of what the setup and workflow is like with each of these frameworks without a huge time investment on your part. You'll discover very swiftly that frameworks introduce positives (readability, re-usability, testability) and negatives (boilerplate, big ol' build/type systems, more npm dependencies that you can imagine).

From there, you can decide whether the pros outweigh the cons given your use-case.

My personal preference is React, tested with Jest. I make a point to avoid introducing things like Redux and Thunk et. al. until it's absolutely necessary (which it frequently never is).

Collapse
 
ericpaulbasbas profile image
ericpaulbasbas

Thanks Leighton for that response, I might do what you suggest and test a very small component of my app using those frameworks/libraries.

Collapse
 
isaacdlyman profile image
Isaac Lyman

Spot-on. I did this on a team I was on, and it was an excellent (and fairly quick) exercise.

One thing you should also do is make sure that stateful components--perhaps something a little more complex than an input or button--can interact well with the rest of your application in a given framework. In my experience, any framework will get you off the ground with a simple app in a couple of days, but some frameworks (notably Angular) do not play nice with anything outside of their own walled garden.