DEV Community

Cover image for Start Using React.js
Michael Gee
Michael Gee

Posted on • Edited on

Start Using React.js

This post is a response to the post that got some traction last week Stop Using React.

I feel like this post was a bit misguiding because it lists problems but no real solutions or alternatives.

Instead of focusing on the negatives, I instead would like the focus on the other side of the argument and the benefits you get from using React.

Solve Real-World Problems ✅

Let’s be real here if you literally just want to print “Hello World” to the screen or have a single page CSS portfolio you probably don’t need the additional JavaScript.

But let’s go back to the real world, companies solve more complicated problems and require more complicated solutions.

If you want to spend months wasting time recreating what React and its ecosystem provide out of the box just for MAYBE getting a couple of seconds of performance increases, please be my guest.

The Job Market 💼

Once I finally bought into learning React, it took me about 4-6 months to find a job. Jobs with React in the requirements or recommendations are everywhere and for good reason.

I believe it is smarter for companies to use more mainstream technology so the onboarding process of hiring new developers into their companies isn’t a bigger hassle than it already is.

It’s hard to find good developers that meet your cultural and technical needs, so having a larger pool to search from is obviously going to make this process much simpler.

“That Company” 🏢

While I don’t always agree with the actions of "the company" itself, I find the React core team to be a great group of people who are passionate about keeping the library and its ecosystem great.

These "companies" continue to provide great free open source technology for others to use. Yes, this does mean sometimes you can get vendor locked but it is your choice to make.

In my opinion, the benefits HEAVILY outweigh the costs.

Ecosystem and Community 👥

It’s overwhelming trying to fathom just how huge the React ecosystem is.

I never feel stuck when developing with React. If you come across a problem, 9 times out of 10 there will be a well maintained external library that solves it.

I have a post here that goes into some of the pros and cons of this so I won't list them here.

TLDR: Choose external libraries that are well maintained and backed by the community.

Performance 📈

It's not a secret that adding React or any other major JS framework to your project will come with performance costs.

Especially if you show statistics of a bloated create-react-app that doesn’t include code splitting and other performance enhancements the performance metrics probably will suck.

There are multiple ways of not only improving these performance metrics but providing users with visuals that will occupy their time until the screen is interactive.

It’s easy to forget that React is built for and used in some of the most visited websites in the world.

Let's consider the hundreds of MAJOR use cases like Facebook, Uber, Netflix, Instagram, Salesforce, Medium, Reddit, AND WAY MORE that ship React to millions of users daily.

Don’t you think these companies have thought of these metrics? If the performance is so bad, why do they all use it? So consider the point it’s not React itself affecting your performance, it’s how the developers implement it.

#UseThePlatform… I’ve Been There, Done That 🤦‍♂️

I’ve been on the other side, I was a huge advocate of #UseThePlatform and not needing all that extra bloated JS coming from JS frameworks.

Ever head of Polymer.js? Probably not. I will admit I loved the technology and the ideas it originated from. I loved the people behind it who were passionate about it and used it internally at Google.

There was a lot of hype and initial backing but never really got off the ground. It never got anywhere close to the external features and community support that you would get by some of the other popular JS libraries.

I constantly found myself stuck in development looking for answers which is what eventually lead me to React.

I now have 2+ years of professional experience with React and I have not looked back since.

Conclusion

This is my take on the high-level benefits to using React. There are many other benefits (developer experience, usage of JavaScript, and many others) although this post was mainly focused on responding to the opposition.

That being said, some of the benefits could also be directly applied to some of the other major JavaScript libraries/frameworks and is not exclusive to React.


As always, if you like this post give me a follow here on DEV and on Twitter.

Top comments (24)

Collapse
 
thefern profile image
Fernando B 🚀

That react post is an example of pure negativity. If we go around and look at everything negative in life we'll have a 30,000 page book. If you personally think something isn't worth using, then don't use it. Saying is made by those people is heavily biased, and not really a fact. The slow point was really the only fact in that post.

Collapse
 
michaelgee profile image
Michael Gee

I agree although I try not to respond to negativity with negativity.

Like you said he has a valid point about performance but what bothered me is that there were no alternatives, improvements, or constructive feedback in the post.

Yes, React comes with costs but what do you gain from it? That is the question I try to answer here and really only scraped the surface responding to the opposing post.

Collapse
 
akhalinem profile image
Abror Khalilov

Totally agree with you.

Collapse
 
amt8u profile image
amt8u

Just read both the posts. Here are my two cents on the topic.

Every framework/library has its own place. Every thing is there to solve specific problem. Its all about the use case. People have to understand not every website is made for public. Web apps are everywhere now. Many products are just web apps intended to be consumed by only a handful of people.
Intranet applications like system monitoring, user management, employee cms, admin dashboards with many graphs and user preferences. They dont need caching and probably are not meant for mobile devices.

Of course you can build anything using just the server but frontend frameworks make it easy. Single page apps serve a purpose.

You need to figure out what suits your requirement. And of course thats not an easy task. Thats where experience comes in. You need to know the design patterns that framework follows.

Also to add one more thing. React or similar frameworks are not made for creating todo apps or login forms. You will see the potential difference only when your apps grows to a certain scale. Until then it will be an overhead only.

So just dont blindly start using react coz its there. Analyze if you really need it.

Collapse
 
michaelgee profile image
Michael Gee

I couldn't agree more, I am not here advocating "React is the answer" because that would be equally as ignorant as telling people to just stop using it completely.

React is in the title because obviously it is responding to a post that mentions it directly and I have experience with using it personally, although some of the points I made can be directly applied to the other major JS framework/library options.

Collapse
 
amt8u profile image
amt8u

Got you:-) To add one more point, React is not easy. Just for example, its been months I having been using it, but I still encounter this almost daily - Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment; No I want a cup of tea:-D

What I want to highlight is that there is a learning curve associated with every framework. And there is no such thing like learn once and write forever. Need to constantly learn as the tech evolves.

Collapse
 
akhalinem profile image
Abror Khalilov

You are right

Collapse
 
michaelgee profile image
Michael Gee

haha yea I agree. The three guarantees in life are death, taxes, and developers arguing over the technologies they advocate for.

the purpose of this post is just to provide an opposing perspective and not "fight" with anyone 😄

Collapse
 
markohologram profile image
Marko A

I feel like this post was a bit misguiding because it lists problems but no real solutions or alternatives.

I agree with this one 100%. I would have loved to see more solutions offered to these problems that the author listed.

Also, there was one great comment that I saw that said on YouTube regarding this:

To be fair, his argument is more like anti-javascript in general and React is just for clickbait

I would also agree with that comment. I don't mean to attack anyone, but that title could have been "Stop using Angular/Vue/Svelte/Ember/Aurelia/...". It's just that React brings a lot of attention (clicks).

Collapse
 
michaelgee profile image
Michael Gee

I agree, but really what is an ideal alternative to even the other major frameworks?

As I mentioned in the post I LOVED the idea of #UseThePlatform as a replacement to shipping these frameworks only to be met with frustration in development.

Not only a lack of solutions to common problems (external library support) but also the lack of community aka googling answers to commonly found problems/bugs in development.

I would much rather ship something to production that has a few performance flaws to later be optimized than delaying the release for months trying to find what I can use to replace it.

Collapse
 
markohologram profile image
Marko A

I agree with you completely. There are probably alternatives, but we go into "creating your own framework" territory, which is ridiculous if you need to create an app and ship it. Framework has thousands of developer hours invested into it, that provides a lot of value.

I didn't mean to attack you or anything, what I meant was that the author of that article should have listed more solutions, not that you didn't offer them in your article.

Thread Thread
 
michaelgee profile image
Michael Gee

Oh no, I didn't take it like that at all. I was just giving my 2 cents on the fact that the "Stop Using" post was maybe steering people down a road I've traveled and experienced a lot of frustration with.

React has saved me countless hours in time and energy both in my personal & professional projects so I felt a strong need to post (some of) the benefits you gain from using it.

Collapse
 
badpractice profile image
Bad Practice

You mean where people still try to drag others for using PHP? 😒

Collapse
 
dtighe007 profile image
Dan Tighe • Edited

Whats wrong with PHP? I thought you guys were discussing front end anyway

Collapse
 
ishansrivastava profile image
Ishan Srivastava

Not a fan of php myself, but at the moment : mark (1.1) which is a php7.4 framework is the fastest.
Rise of the dead ??
github.com/the-benchmarker/web-fra...

Collapse
 
ivan_jrmc profile image
Ivan Jeremic • Edited

React is amazing, this negativity comes mostly from people who where not able to wrap their head around jsx, but in fact it is easy and makes only sense because creating elements is a core feature in javascript itself which is also the reason that you have curly braces in you jsx, onClick and so on .... because it is a js function and functions have curly braces. I think the way react is built is the right way for now and even the web itself has learned from it and I think we will see html itself getting closer to the react way. Everyone is talking about seperation in vue and so on, but look at vue you need to register components and go houndres of times up and down to create your components what react offers are for me really components create a function add some logic and return the markup it is amazing, and you can pass even components as props which you cannot do in vue or other frameworks.

Collapse
 
tirthaguha profile image
Tirtha Guha

Yeah, agree, that application didn't make much sense. Probably the poor guy couldn't get his head around JSX and vented out.

Collapse
 
yoursunny profile image
Junxiao Shi

I use Preact. It's basically React without the baggage.

Collapse
 
madza profile image
Madza

Hahah, a week ago I saw 'Stop using React' 👀😃

Collapse
 
jsphwllng profile image
joseph

well now i dont know what to think