Hacker News new | ask | show | jobs
by azeemh 1377 days ago
I agree with your perspective on separation of concerns as that was the intent of the html5 standard.

The reason react was invented was to enable real time update of items on the page -- to update when someone liked your item, or send you a notification update instantly instead of polling the server.

It was the idea of pushing code to the webpage. So they made a component in javascript that updates in realtime -- the state or prop determining the content or how many likes the post had. However this ended up requiring a huge Redis instance which is also very expensive, so now they need to sell more ads. In order to figure this out they realize emojis on the like button allow people to choose a sentiment of their reaction to the content. Their ML uses the sentiment to group and sandwich ads between content the ML knows or thinks you will react favorably.

So for example, a comedy central ad will be shown after a meme or story that is similar or something you reacted Haha to because the advertiser's desired reaction is a Haha as well.

Thus the name React. Plus it makes that div/element/part of the page defined as a "component" in js that will update or "react" in realtime -- anytime they push an update to the server everyone viewing that page sees it change in realtime.

Essentially a combination of a push notification or pubsub and ajax request.

Honestly, when jsx goes out of style like it should because its idiotic, and gross, and a violation of those separations of concerns, it could just be an html page where you write a js function to add a realtime update to an id or class...

Svelte uses that style of approach to the DOM.

If you don't have a realtime data store like Redis or any type of realtime data streaming going on, React or any other component based framework is a waste of time.

The ability to update the page without reloading or building as a single page app is not SEO friendly unless you use SSR which you already would have created in your normal seo friendly html files.

also name your files consistently and clearly.

unless you need to change the page in realtime without reloading, react and these other component frameworks have no use case.

If you want a clean css3 framework to help build a web front end that works neatly in html5 check out Bulma.

Bulma.io

You are exactly right, the js developer scene is like a herd and people wanted to work at facebook or look smart so they learned it.

It's useful for making single page applications, however all framework interactivity can be written in normal js, so if you take your time you'll have much cleaner, unbloated code, yielding pages that run better and faster...