News for hackers. Stuff that matters.
Re:Things you forgot because of React by robertoandred on Tuesday August 15, 2023 @01:16PM (#37136610)
And how many libraries and frameworks and methodologies are there for server-side state management?
Re:Things you forgot because of React by ttfkam on Tuesday August 15, 2023 @02:33PM (#37137565)
State on the server side is often a very different animal from client side. Whereas on the client, everything is either JS and/or a browser API, the server side allows for relational databases, Redis caches, and all sorts of other strategies, some based on session ids while others using whatever fits for that scenario. "It depends" but it's not just a library or framework as you'd imagine coming from frontend development.

Htmx is quite popular among folks who prioritize and enjoy server-side development. Svelte is likely more popular among folks who enjoy browser-based development. There is certainly some overlap between the two camps, but that's my take on it.

Re:Things you forgot because of React by robertoandred on Tuesday August 15, 2023 @03:47PM (#37138457)
Wow. Relational databases, Redis caches, session IDs, different strategies for different scenarios... sounds like a fustercluck, no?
Re:Things you forgot because of React by ttfkam on Tuesday August 15, 2023 @07:37PM (#37140817)
Not if you're a backend engineer. Then again from their point of view, they consider frontend state management to be a hopeless mess. Takes all kinds.
Re:Things you forgot because of React by robertoandred on Tuesday August 15, 2023 @11:47PM (#37142651)
And why does a backend engineer's point of view on frontend state management matter? Why is a variety of options and strategies for different scenarios ok for the backend but not for the frontend?
Re:Things you forgot because of React by ttfkam on Wednesday August 16, 2023 @08:59PM (#37155848)
The frontend has… a browser. It's a much more constrained toolbox. You are forced to use JS and whatever browser APIs made available to you.

The server side is only limited by what can run in a datacenter. Any language. Any service type. Any scaling profile.

Neither is more "correct". Both have pros and cons. As for why the backend engineer's point of view matters: if you are server-side rendering, you will have a better chance of going faster. A browser will always render HTML faster than JS that generates HTML on the fly, and the server side can always be made to generate HTML faster than a browser could. You can always simply throw more hardware on the server side to speed this up whereas you have basically no control over the performance profile of a random user's browser.

Look at Google search results. It's typically not JSON over AJAX; it's rendered HTML dropped into place. Why? Because every millisecond can be quantified into gained/lost revenue.

Re:Things you forgot because of React by robertoandred on Thursday August 17, 2023 @11:56PM (#37171245)
So why is it bad to choose a frontend state management strategy in a way that maximizes revenue?
Re:Things you forgot because of React by ttfkam on Friday August 18, 2023 @09:02AM (#37175057)
> Neither is more "correct". Both have pros and cons.

I think frontend state management is a completely legitimate choice if it fits your use case.

Re:Things you forgot because of React by omnimus on Wednesday August 16, 2023 @05:08AM (#37144490)
Are you aware that these things still exist in apps no matter what kind of state management they use?