r/javascript • • Jul 27 '21

You don’t need React for building websites

https://www.silvestar.codes/articles/you-don-t-need-react-for-building-websites/
0 Upvotes

12 comments sorted by

15

u/Cyberlane Jul 27 '21

Honestly, this isn't anything new. Before React I'd see Angular, Bower, Backbone, Embed, jQuery... People would put out ads for specific frameworks rather than the language they're written in. In the past 20+ years I've been employed as a developer, I've only once ever had an employer that had a job ad which perfectly described the work they were doing, why they used specific frameworks, etc.

People will jump on something because it's popular or fun, or it's easier than knowing how to do things yourself and them the jobs advertise for people that can join them.

I fully appreciate React and feel it's great for a number of webapps, similarly I appreciate some aspects of modern Angular. However, I also understand from experience when to use a static html page and when to involve a JS framework. This experience is lost to a lot of the younger generation and unfortunately, is not easy to regain due to the popularity of these frameworks.

1

u/nickelickelmouse Jul 27 '21

What criteria do you use to decide when to use static html vs when to use a framework?

3

u/Cyberlane Jul 27 '21

Please bare in mind that my decision process is based on my own experience and of course is not the "absolute truth" that everybody should copy.

So for me I tend to ask myself some questions

  1. Does it need JavaScript at all? Would just html and CSS be enough?

  2. Does the design need to change/react based on data or user input? If it does, is it more complex than a simple show/hide?

If I can avoid having a JS dependency entirely, I get quicker load times, less network overhead and less to consider when doing SEO.

If I do need JS, again, if it's extremely simple JS that doesn't need to perform any complex interactions on the page or with data that is represented on the page, I again prefer to make my own simple JS (smaller bundle).

Again, this my personal feelings on this and often when working in a team with other developers, I tend to present my suggestions with my reasonings but if the team disagrees and still want to use a framework, I go with it. That said, I tend to do consultancy work primarily now, so I tend to come in to solve specific projects or problems and do not need to interact much with bigger teams anymore, usually just a tech lead.

1

u/call_innn Jul 28 '21

I agree with you on a number of point here but you can't say the "young generation" has lost that experience of choosing the right tool for the right job because that is just untrue and isn't even their job to begin with in most cases.

You might see a lot of young people using frameworks to make small things that could have been made by hands because they are learning that technology. You can't just learn on full scale web apps all the time.

You also need to understand that it isn't that "younger generation" that made this flooded ecosystem. They didn't choose to work this way but it was imposed to them.

1

u/Cyberlane Jul 28 '21

It's not so much the problem with the younger generation at all, it's more that they are brought into a mess we created and not given a chance to gain experience in most cases. Some are lucky and work at good environments to learn and do better, but so many end up just indoctrinated to framework hell.

1

u/_default_username Jul 30 '21

Younger people need to build up their portfolios and get that experience. That's probably a big motivator.

5

u/eternaloctober Jul 27 '21

quote from article: "It is fair to say that I don’t understand it, so I cannot even rant about its features, shortcomings, or flaws."

come on now. let me be clear: I also developed a lot of web stuff pre-react as a junior programmer, worked on large projects pre-react, and I really struggled to learn react. I didn't get it. for some reason staring at code with proptypes and class based react really confused me and distracted me from what is more important. function components really transformed that. it's a lot easier to understand when you think: react is just functions that return JSX

function HelloWorld() { return <div>Hello world</div> }

...and you can "call" your function components using jsx

function App() { return <div><HelloWorld/></div> }

and by doing this, all your code is "componentized" and you dont get insane jquery spaghetti. that is "all you need" to get started and you can go from there...learning the hooks and what re-rendering is and controlled components etc. that will all come thru after you just start trying stuff

11

u/bhison Jul 27 '21

You also don't need a mouse

-1

u/bighi Aug 01 '21

The difference between React and a mouse is that a mouse makes most things easier and faster.

-6

u/[deleted] Jul 27 '21

Angular Gang!

12

u/[deleted] Jul 27 '21 edited Jul 30 '21

[removed] — view removed comment

2

u/_default_username Jul 30 '21

This, one of my projects is migrating a company from old java apps, and Java applets that only run in internet explorer to react web apps.