My problem with React. Why people use it?

When I started using React I didn’t fully understand what advantages it gives, it’s fair to say I started using it “because that’s what everyone’s doing”, and I thought “OK, I’ll get it in the process”. Now, couple years later when I learned a bit about all the underline technologies of the Internet, system architecture and this thing called HTTP2 in particular, I’m like “So… why am I using React again???”. And as I don’t have an answer to this, I’ve decided to ask for a help on the forum “because that’s what everyone’s doing” :slight_smile:

I have 2 questions:
Why do you use React?
Is React more than just a template engine (Mustache, Underscore, EJS, Handlebars) for you and why?

THANKS!

First of all, React has nothing to do with http. Underscore is not a templating engine.

But ultimately if you don’t like it, don’t use it. Period. Do what you want.

Why do I use it? Because I find it an incredibly powerful tool for organizing and structuring the different parts of my app. I can’t imagine working on an app the size of what we have at work without something like it. It would just be a nightmare.

Yeah, you can get some of the same functionality with those templating engine. But I like the way React works better, how the pieces communicate.

Use it or don’t. When people ask me “Should I learn x, y, or z?”, I respond by asking which is more likely to land a job. Scan the want ads where you are and see how many times you see Mustache mentioned and how many times you see React.

Part of learning is the humility to say, “I don’t know this. Someone else is more experienced than I am. I’m going to trust that they know what they are talking about. It may not be what I would choose, but then, they know more than I do.” Having spent decades as a music teacher, I’ve seen a lot of the “I don’t want to learn that because I don’t see the value in it” attitude. They usually don’t fare well.

Do or don’t, it’s up to you. Frankly, when I first started React, it didn’t make much sense to me either. It wasn’t until apps got larger and I got better at React that it started to make sense.

As far as listing the benefits of React, there are plenty of resources on the internet. If they didn’t convince you, then there’s no point in me trying.

2 Likes

Underscore is not a template engine, you right! And copy/pasting is a bad practice :slight_smile:

I love React, my question is not about love/hate. For me React eventually creates an app for the web, just like any app on device. And just like any app on device it has to be served as a bundle - it makes total sense and it definitely has some advantages, no doubt about that. Now to the core of my question, is this ‘bundle-to-app’ approach is good for document-based Internet in the first place? Is it secure? Is it efficient?

React enforces certain behavior of loading as much data* as possible and store it on the client-side, you can’t deny it.

*Consider this amazing React app https://looka.com. It sells logos. The problem that they also send out all their 371 logos in svg (vector format) right away and you can access them through the redux store.

Bundling is one way to serve a React app. There is also SSR. There are advantages and disadvantages to every approach. If you think the disadvantages of React outweigh the advantages, then don’t use it. Unless you want one of the many jobs out there for React/Angular/Vue.

React enforces certain behavior of loading as much data* as possible and store it on the client-side, you can’t deny it.

I can deny it and I do.

The problem that they also send out all their 371 logos in svg (vector format) right away and you can access them through the redux store.

And you think because they did it that way that it is the only way? You can’t imagine serving the logos from a server as needed? There are other ways to do things.