I assume your suggestion here is just to embrace a framework for data fetching and try not to think too hard about how they in turn implement it?
Can't really fault developers for falling into this useEffect trap when even the official docs show that data fetching is indeed handled via useEffect[1], while at the same trying to yell at the reader to "NOT TRY THIS AT HOME" and just go use a framework because it's such a complex problem... which naturally just creates more questions than answers for the poor developer trying to understand how it all works.
Uhh... That's terrible piece of docs. They don't even cancel stale fetches, just ignore the recieved responses. They don't debounce anything.
There are so many things about syncing data between the client and the server that this section of the docs should just say "Don't", use Apollo or Redux or whetever. React is UI library, for data you need data library or at least general state handling library. Quick and dirty will bite you tenfold.
> Sapolsky’s argument can be summed up like this: “We are beings caught in an unbroken chain of causes that dictate our choices. We lack free will and are wholly subject to circumstance. Therefore, we should choose to be better to each other.”
> This is a contradiction.
It's only a contradiction if you keep thinking in "free will" terms, i.e. thinking you have a choice in the matter.
The problem is that he has to use the language of persuasion and "choice" to explain why not believing in free will has benefits. But that's a weakness of our language around the subject, he's not expecting anyone to "choose" to change their position on the subject.
What he's actually doing is becoming part of your causal chain, and by voicing his opinion he's trying to change your future behavior. Ironically, in a world with no free will, we end up having more agency over others than ourselves.
Your behavior after reading the book was never a matter of choice. Either the past events in your life will lead you to modify your behavior upon adding the information in the book to your life or they won't. Sapolsky's entire point is exactly that, there is nowhere a choice _can_ be made. All we have is the illusion of a choice being made when we reflect on our behaviors and try to rationalize them post-hoc.
Arguments to the doSomeWork can be carried through to someCleanupFn as can any return values from doSomeWork.
If doSomeWork returns all the pieces that need to be cleaned up by someCleanupFn (or those pieces are part of the original arguments), then those values can also be passed in as arguments to someCleanupFn.
This pattern (passing original arguments through, along with return values, to a supporting function) hints at a more elegant solution as well - a new monadic structure that supports this behavior by default.
I've only read Outliers and David and Goliath, but I really enjoyed them and feel that they provided some tangible benefits in how I think about things.
Could you share some of the criticism against him so I could update any incorrect beliefs I may have?
My opinion flipped the other direction. Which totally surprised me.
I used to dismiss Gladwell's "insight porn" (h/t lordnacho). But now I feel like he's a pretty effective advocate, popularizer of views and policies that I agree with. Briefly, he's punching up.
Michael Lewis was the catalyst to reassessing Gladwell. I just frikkin love his Against The Rules podcast series. Briefly, he argues that we do better, both as society and individuals, with referees and coaching.
Then I listened to a handful of Gladwell interviews. A long form chat with Lewis. Book tour stops for Talking with Strangers. I thought: Huh, Gladwell doesn't sound too bad.
So I started listening to other Pushkin Industry podcasts.
I especially love historian Jill Lepore.
So I guess my TLDR is: I reevaluated Gladwell because he's now working with two people I really admire. Virtue by association.
I've been out of the phone market for a while, but have we reached a point were we're celebrating that we can pay $40 to buy a kit to change the battery of a phone?
When and why did this become a thing? I remember screens being a pain to replace, but the batteries just plopped right out.
Edit: Sorry, that came out more cynical than I intended. I'm just curious why we did away with batteries that fall out.
I used to use a Moto G2 as well and I second this. My volume-rocker keys were super wobbly, and literally popped-out in my finals days with the device.
Can't really fault developers for falling into this useEffect trap when even the official docs show that data fetching is indeed handled via useEffect[1], while at the same trying to yell at the reader to "NOT TRY THIS AT HOME" and just go use a framework because it's such a complex problem... which naturally just creates more questions than answers for the poor developer trying to understand how it all works.
[1] https://react.dev/learn/you-might-not-need-an-effect#fetchin...