Remix.run Logo
austin-cheney 3 days ago

So, state is simple, stupid simple.

The way to keep it simple is to have a single state object, which is the one place where state is organized and accessed.

The way to make it scale is architecture. Architecture is a fancy word that means a repeatable pattern of instances where each instance of a thing represents a predefined structure. Those predefined structures can then optionally scale independently of the parent structure with an internal architecture, but the utility of the structure’s definitions matter more.

Boom, that’s it. Simple. I have written an OS GUI like this for the browser, in TypeScript, that scaled easily until all system memory is consumed.

alternatex 3 days ago | parent [-]

I feel like you completely misinterpreted their comment. They replied to a comment saying that state should not be centralized. They said that if the state decentralized (as in held by individual child components) it's difficult to coordinate between sibling and parent/child components.

It seems like you're saying that it's easy to do UI with a centralized state, therefore agreeing with them whilst having the tone of disagreement.

austin-cheney 3 days ago | parent [-]

The parent comment said: This approach is simple but does not scale and You need separation between components and data. That is garbage and is what I replied to.

I completely understand why JavaScript developers would fail to read this as such as most JavaScript developers are wholly incapable of programming, a forest for the trees problem.

afiori 2 days ago | parent | next [-]

But centralised state is "separation between components and data"

nsonha 2 days ago | parent | prev [-]

> JavaScript developers would fail to read this

> You need separation between components and data

this is an universal way to do UI, in fact only javascript developers (out of curiosity, are you one?) would even argue against it, because "use the platform", vanila, simple... blabla, or you know, "incapable of programming" and thinking in terms of data flow as opposed to platform intricacies

austin-cheney 2 days ago | parent [-]

The worst part about working in JavaScript is the insecurity. Everybody likes to act like they know what they are doing, but very few people really do. So, for most people its entirely a game to remain employed when they probably aren't qualified to be there in the first place. Its like musical chairs where everybody hopes when the music stops its the next guy left standing.

For the few people who do know what they are doing its an impossible situation. People simultaneously expect magic from you, because they know you can do it, but at the same bitch and cry about the output. They know they cannot write original code or extend somebody else's original solution so they demonize it out of self-preservation. When people are universally that insecure its convenient to hate on that one person who doesn't share that insecurity.

That is why I switched careers. I have never seen a salary high enough to justify going back to that.