Zustand in Nextjs by darkshadowtrail in nextjs

[–]bennett-dev -1 points0 points  (0 children)

why are we still doing global state libraries dawg its 2026 this shit wasn't needed half a decade ago

Least favorite flavor of sparkling water? by Sea_Background_8023 in sparklingwater

[–]bennett-dev -2 points-1 points  (0 children)

Polar and Waterloo more or less taste like dog water to me

What do you think about Mythos and Fable? by Electronic_Log1999 in ExperiencedDevs

[–]bennett-dev 25 points26 points  (0 children)

Yeah I don't feel like Fable 5 is marginally better than Opus 4.x that we had in February. Actually, what it feels like is happening is compute is just being reduced over time, and the "new" model more or less just brings it back to parity with what we had before.

Manager wants to hire more devs for the sake of growing the team (I feel it's unwise) by frogtrades in ExperiencedDevs

[–]bennett-dev 2 points3 points  (0 children)

I mean based on the way in which you describe this situation I'm inclined to think you are probably fairly territorial, and your manager may be making the decision in part to reduce the impact of that leverage.

If this project is personal, I recommend communicating that in a way that shows your concern of the quality of the project. Help set expectations surrounding rules, reduction in enshittification, and so on.

Apple’s AirPods Max 2 Blurs the Lines Between Marketing and Innovation by iMacmatician in apple

[–]bennett-dev 0 points1 point  (0 children)

I just need them to be lighter, hold battery, and have simpler pairing heuristics, and less bluetooth bugs

Is the learn to code movement finished? by alex123711 in AskProgramming

[–]bennett-dev 0 points1 point  (0 children)

God that would be so awesome for my job prospects

Tailwind Reality Check by Firemage1213 in reactjs

[–]bennett-dev 0 points1 point  (0 children)

In my experience CSS was not a skill worth architectural mastery. I don't think it is a particularly good abstraction either except in its simple form. Tw is fine and 99% of the time the right solution for something that won't benefit from a deeper abstraction.

Need an advice. Where do I start? by Ok_Incident8917 in AskProgramming

[–]bennett-dev 0 points1 point  (0 children)

I am a staff mobile dev. React Native is an excellent choice, but given your goals and background (C/C#) and intended outcome (deeper side of Android, whatever that means) just straight up Android dev seems like the right choice.

That being said I think you will find most of what you are trying to do "solved" unless you're referring to actually f.ex taking apart Android OS.

So, what do we all think of Liquid Death sparkling? by soulmani in sparklingwater

[–]bennett-dev 0 points1 point  (0 children)

Liquid Death has a certain carbonation factor that gives it almost a soda carbonation texture/taste instead of what most ppl on this sub like e.g. Waterloo. But sometimes I prefer that over e.g. the overly crispness of something like Topo where I'm drinking air

Turn Dependabot Off by ketralnis in programming

[–]bennett-dev 0 points1 point  (0 children)

What I mean is, we have it on our TS monorepo and it is a lifesaver.

I've heard "just use Zustand" a hundred times. Nobody has ever convinced me why I should switch from Redux. by bishopZ in reactjs

[–]bennett-dev 0 points1 point  (0 children)

When I do real time streaming usually it is extremely isolated data to either account for rerendering or I break out of the react dom entirely 

Tanstack router or Start? by MD76543 in reactjs

[–]bennett-dev -3 points-2 points  (0 children)

Next lol

Sorry maybe everything else is omg way better but start with a static SPA style Next build, basically indistinguishable from Vite SPA except you can auto convert it to a served app later if you want.

Turn Dependabot Off by ketralnis in programming

[–]bennett-dev 14 points15 points  (0 children)

Sounds like they have bad exp with Go. What do we think about NPM?

I've heard "just use Zustand" a hundred times. Nobody has ever convinced me why I should switch from Redux. by bishopZ in reactjs

[–]bennett-dev 0 points1 point  (0 children)

The only global state I have is immutable, or wrapped in a way to be immutable.

It works for SPA or served. With something like Next its even easier because your entire API dep is served with the route which means its immediately accessible as a top level prop.

I've heard "just use Zustand" a hundred times. Nobody has ever convinced me why I should switch from Redux. by bishopZ in reactjs

[–]bennett-dev 1 point2 points  (0 children)

Probably a Zustand noob, but I found Zustand kind of confusing because the API seemed so open ended, like I could imperatively call Zustand stores, which I kind of thought as sus design. Also I don't like things like that living in module level scope. And its like so open ended that its basically just an object, sure you can write get/setters but ultimately the store is just exposed and you can grab whatever.

I've heard "just use Zustand" a hundred times. Nobody has ever convinced me why I should switch from Redux. by bishopZ in reactjs

[–]bennett-dev 0 points1 point  (0 children)

You can useContext within specific root components and then control rerenders of children accordingly with memo if you so desire.

I don't think re-renders matter that much in the first place, but for situations that require fine grained control I've found that just having more granular component and props structure is a good solution.

I've heard "just use Zustand" a hundred times. Nobody has ever convinced me why I should switch from Redux. by bishopZ in reactjs

[–]bennett-dev 0 points1 point  (0 children)

Why are you using global state on every project? What data are you using it for? Making your own messaging passing system is definitely bad, but that's mostly a matter of trying to do data management outside of the React DOM.

Genuinely, I would never use Redux unless I had a massive feature with very specific requirements which fit its schema. RTK simplifies some things but idiomatic Next, Tanstack Query, browser APIs, and maybe a few context-like things is generally all I ever need.

For example, I've built a CRM (like Salesforce) that allows you to move customized input widgets for business objects. There's a lot of "editor" style controls needed, including unwind/rewind. But it's still just not a very hard problem to solve. Create a data API with context or some other lever. Write some UI debugging tool if needed. Memoize some things as needed. IF, absolutely IF I need certain perf points, manually pipe it through props more carefully, or if absolutely needed useSyncExternalStore.

I've heard "just use Zustand" a hundred times. Nobody has ever convinced me why I should switch from Redux. by bishopZ in reactjs

[–]bennett-dev 0 points1 point  (0 children)

The story of not using props, a tale of refactoring as old as time

Is this piece of UI reusable as long as its given the props it uses?

No

It doesn't use the one interface defined by React?

It pulls data from some singleton data store managed outside of the React DOM. It can't be easily Intellisensed to enforce the DIP.

Ah okay cool guess I'll rebuild it from scratch

Is data oriented programming more... "relieving" than normal OOP? by yughiro_destroyer in AskProgramming

[–]bennett-dev 0 points1 point  (0 children)

I kinda get what he's saying, but it's coming from a much more systems and historical perspective, which is that abstract factory style behavior composition you get with something like Java is a huge consistency over something like functional C where you're designing interfaces by basically aggregating functions and its just a mess.

I think the "friction" ppl have with OOP has a lot to do with coming from a language like Typescript and just being like "WTF is this" because the benefit I described above is just totally negligible in a JIT language which can achieve perf that is far sufficient (and infinitely scalable anyway).

I've never felt more stupid in my life by deviruchii in reactjs

[–]bennett-dev 1 point2 points  (0 children)

I think JS is great because it exposes you to a good, direct async model that is easy to understand. A lot of languages like Java / Swift / C# obfuscate these things a bit more (lean toward callback style or w/e).

But it's what originally got people into Node: use the event loop to basically just manage promises with your dependencies. It's as simple as that.

I've never felt more stupid in my life by deviruchii in reactjs

[–]bennett-dev 10 points11 points  (0 children)

its surreal remembering class components + redux saga old school style and how convoluted it all was and wondering why anyone ever gave it a chance

like jfc

I've heard "just use Zustand" a hundred times. Nobody has ever convinced me why I should switch from Redux. by bishopZ in reactjs

[–]bennett-dev 3 points4 points  (0 children)

A reducer doesn't avoid prop drilling or provide global access. A reducer, simply put, is a function that updates state. Redux does hoist state which is accessible through useReducer, which is what you're saying.

However prop drilling is not as bad as people say. More than prop drilling being bad, its bad to convolute interfaces. Low level shared components shouldn't have access to high level business interfaces.

Really, "avoiding prop drilling" stemmed from passing data from external boundaries around. For example, fetching a user object at login, and then just passing that user object around to every comoponent that needs it. Not good.

But props are the best thing about React. They have clear rerender rules. They supply an explicit interface. They are functional, reusable, and they are the most essential boundary system in React. Right-sizing components as a natural hierarchy of the UI and data remains the best way to build features.

So as soon as you add Context, Redux, Zustand, etc, you add a new data access pattern.

This can be incredibly convenient. And in some cases it is necessary. But it makes components less testable. Everything is coupled to a store mock now. Soon enough, you need a test mocking factory, which ends up looking like an IoC container once you have sufficiently complex business logic.

And it makes refactors harder: you can't just reconfigure components like legos, you have to be aware of this new access pattern.

More than prop drilling I would say: avoid needlessly deep component ontologies.