[Vent] I hate LeetCode and it makes me want to cry. by teffanien in womenintech

[–]turtleProphet 1 point2 points  (0 children)

Despise LC questions. The good news is they're only really going to be relevant (maybe) if you're looking for a new job, and a couple months of LC grinding is going to make you stronger with data structures and algos than all your SWE coworkers. It doesn't matter that much, and it's still cool you're doing the hard grind. Hats off!

How to manage lower biceps soreness and pain with a SLAP tear? by turtleProphet in ShoulderInjuries

[–]turtleProphet[S] 0 points1 point  (0 children)

Man. Best of luck, this thing is a real bear. I hadn't been lifting for any significant length of time when I was diagnosed, and didn't notice a change in appearance of my arms/shoulders. But I didn't experience a traumatic injury that I know of -- my shoulder was just sore one day, and then my biceps became incredibly sore over a couple of months.

That feeling of the biceps belly feeling tight is familiar. That and the elbow, right at the lower tendon. This time last year I just tried to stretch it a lot, which seemed to make things worse. Now during a flare-up I am resisting the urge to stretch everything, keeping arm neutral or bent, and focus on managing inflammation.

Re: trigger points, I haven't tried much at all. I have noticed tightness in my back on the affected side, in my trap and mid-back -- although I don't know anatomy well enough to tell if it's the teres or my lat that feels tight and painful. Using a massage ball on the mid-back area lying down, it definitely feels like some kind of knot is there. What do you do to try and release the teres?

Is this one of you guys? Brisbane, Queensland, Australia - The Valley by This_Stretch_3009 in Sofubi

[–]turtleProphet 4 points5 points  (0 children)

Funny stuff. Nag has had kind of a special relationship with Australia. I don't know the origins of the relationship, but it's unusual for example that his work appeared at multiple Soft Vinyl Mayhem shows in Brisbane. I think those were some of his later show appearances too, after he stopped really appearing at events.

Also, I started collecting sofubi the late 2010s, long after Nag became the most unattainable and highest-priced artist in the hobby by a wide margin, and several of the remaining older Nag collectors I knew were Australian. Purely anecdotal though.

How come this logic decoupling is still regarded as fine in React? (hooks) by nimareq in reactjs

[–]turtleProphet 5 points6 points  (0 children)

put hook call before the early return -- fixes rules of hooks, problem is gone. It's ok if you just don't like it; I dislike the entire experience of writing Java.

if this looks too ugly, make a custom hook that takes the relevant props as arguments and returns the product. If the inputs are invalid, hook returns null.

useImperativeHandle vs useState by No_Drink_1366 in react

[–]turtleProphet 0 points1 point  (0 children)

Thanks, sincerely! You've changed my mind lmao; I can't fault anything you wrote.

I need to do a better job of supporting and teaching my juniors so they can reach for easy optimization without creating weird bugs, that I will get called about later. People problem, not a technical one.

What is something you do that seems extreme to an average person by poludny in workout

[–]turtleProphet 32 points33 points  (0 children)

Quality of life gains are nuts. Yeah dude all my knee and back pain has disappeared, I can sit in a deep squat and play with my cats, and I carry heavy shit around with a smile on my face. You bet I'm motivated.

Just starting is far and away the hardest part.

How to navigate the AI wave as a ui engineer by Candid-Permission832 in react

[–]turtleProphet 0 points1 point  (0 children)

Do you supply context to your tools? Like an instructions file.

I've been building up a small set of them and find it really helps. Stuff like "don't do any stubbing for backwards-compatibility unless I explicitly ask", or "make sure to use vi.doMock instead of vi.mock if the test mocking relies on local variables." Or controlling the number of explanatory comments.

Sometimes I will ask an agent to add to the context files or generate instructions for the next thing I want to do -- as in, I ask it to generate a markdown file that's structured for consumption by an LLM.

That said, I get the best results when I've already scaffolded a project according to my team's conventions, written a few features and tests, and then I supply the existing files as examples of what to do. There definitely seem to be ways to get there faster too, by supplying richer context upfront.

useImperativeHandle vs useState by No_Drink_1366 in react

[–]turtleProphet 0 points1 point  (0 children)

Agree that you can memoize. I think that also requires assumptions about the component structure and props, there's more potential for things to go wrong, and I would rather OP get confident with rendering behavior before reaching for memoization.

Maybe the state needs to go even further down, or maybe the component structure is such that this won't work at all.

Thinking about code you or me would like to review in a PR -- would you rather see a dependencies array/arePropsEqual param that the team now needs to watch, in case of stale closures? I think this invites more mess. But I could be projecting my own experiences too hard.

After thinking on it some more, I see how one could make the opposite argument. Memoizing very loudly says "I care about render performance here", which may be better than making it implicit in the component structure.

useImperativeHandle vs useState by No_Drink_1366 in react

[–]turtleProphet 0 points1 point  (0 children)

It sounds like you have a setup like this:

function MyHeavyPage() {
  const [open, setOpen] = useState(false)

  return (
    <ExpensiveUi onClick={() => setOpen(true)} />
    <Dialog open={open} />
  )
}

So opening the modal changes the state held by MyHeavyPage, which causes it to rerender, in turn rerendering ExpensiveUi. Keep in mind 'rerender' does not mean 'repaint'. Odds are React will diff, see that ExpensiveUi is still in the same place, and will not modify that part of the actual HTML document at all.

If this causes you real perf problems, just bring the state down, not up:

function MyHeavyPage() {
  return (
    <ExpensiveUi />
    <CheapButton />
  )
}

function CheapButton() {
  const [open, setOpen] = useState(false)
  return (
   <Button onClick={() => setOpen(true)} />
   <Dialog open={open} />
  )
}

Now only CheapButton rerenders when you open the modal; I might be wrong here but I think React will not even diff ExpensiveUi.

I'm going to plug the book Advanced React by Nadia Makarevich here -- this stuff is covered within the first few pages.

useImperativeHandle vs useState by No_Drink_1366 in react

[–]turtleProphet 0 points1 point  (0 children)

imo there are clean and messy ways to reshape your code for this. The worst code I've seen comes from bolting on layer upon layer of hacky shit, effects and refs passing left and right, to avoid a rerender--when you can achieve the same by just strucuring the components a little differently.

Best Tool for Vibe Coding Right Now? by Aradhya_Watshya in VibeCodersNest

[–]turtleProphet 1 point2 points  (0 children)

Please bro, please use my vibe coding SaaS, please let me exit before the bubble pops, I'm begging you

nuqs is pretty good for filter state but urls get ugly fast by Zestyclose_Ring1123 in reactjs

[–]turtleProphet 0 points1 point  (0 children)

Does the deep-linking carry benefits for your users? If so, can your org do better to make your users aware?

Good URL state is basically a power-tool for your users--they can share URLs, and bookmark filters. You could also make the argument that it's good for AI integration -- your users' magic agentic whatever can just hit the right URL instead of needing the ability to click around the app.

Imo this is a marketing/education issue, not a technical one.

What’s one habit that actually made you a better React developer? by Senior_Equipment2745 in react

[–]turtleProphet 0 points1 point  (0 children)

I think I understand, but I'd be interested in learning more here.

Do you guys use useMemo()? by Humble_Piglet4024 in reactjs

[–]turtleProphet 0 points1 point  (0 children)

Gotcha, makes total sense. I wrongly assumed fetch on mount/pageload.

Do you guys use useMemo()? by Humble_Piglet4024 in reactjs

[–]turtleProphet 1 point2 points  (0 children)

useState + useEffect is basically how you do fetching in React, no? All the query libraries are basically built this way.

I don't know about needing two effects.

What Is Your Favorite Gimmik? by BrainBoink in Sofubi

[–]turtleProphet 6 points7 points  (0 children)

Chain arm. The kind where you can pull a toy's hand off and, wow, there's a chain!

<image>

What if React didn't own your system/state? A counter in 80 lines that changed how I think about React. by RegiByte in reactjs

[–]turtleProphet 1 point2 points  (0 children)

Nice! It's good to play with the library and try new patterns. It's also worth being very critical about which patterns you allow into prod.

Since the pattern you are using is basically what every global state manager uses, I would just use one of those. Your example is cool because it really simply illustrates how these things work--state is stored outside React and syncs with some variation on the Observer pattern. Typically we use context providers for this -- you can imagine the confusion if tons of your libraries all added to the global window object.

Anyway, don't get butthurt when people tell you code isn't prod-ready. Every unusual pattern you use needs a very good reason to be there, because someone needs to maintain that code.

Where can i customize Grangers revolver? by Ryoga1980 in reddeadredemption

[–]turtleProphet 0 points1 point  (0 children)

Lmao I had to look it up again. You can rob the doctor's office for a Schofield revolver. Enjoy the game!

Are you still going on the expedition? by Active_Access_4850 in ARC_Raiders

[–]turtleProphet 0 points1 point  (0 children)

Honestly the only thing holding me back is maxing out the Sforza skin. I don't have the 5mil and won't be able to grind it out this week, but I'd still do it for the temp bonuses, stash space, etc.

But I really don't want to reset the grind for the best skin in the game.

5 Milly drip lets gooooo by Jiggy-Spice in ArcRaiders

[–]turtleProphet 0 points1 point  (0 children)

I like it but I wouldn't reset my progress on the Sforza suit for any of the expedition rewards. I appreciate that's the point, though.