News for hackers. Stuff that matters.
Re:The self-fulfilling prophecy of React by BigJono on Thursday September 08, 2022 @09:42PM (#32774325)
Hooks are much better. The only problem with hooks is that people don't get them. But once you get them, every other approach looks like a complicated pile of shit.

I think the dev community does really poorly with these kinds of abstractions that are very simple but completely unintuitive.

I place a lot of the blame on the React team too. When hooks came out, their docs were absolutely terrible. They probably still are. They were full of shitty editorialising like "we created hooks because we found classes were too difficult for people to understand!", which made every dev I worked with feel insecure for not immediately knowing how to write super awesome clean code.

Re:The self-fulfilling prophecy of React by localvoid on Thursday September 08, 2022 @11:03PM (#32774811)
> The only problem with hooks is that people don't get them. But once you get them, every other approach looks like a complicated pile of shit.

No, some people actually get them and there are way much better alternatives[1].

1. http://intelligiblebabble.com/compose-from-first-principles/

Re:The self-fulfilling prophecy of React by danielvaughn on Thursday September 08, 2022 @10:35PM (#32774641)
I'm a big fan of hooks, but I'm still not completely sold on them. I like code that reads in logical sequence, like you're telling a story. When you use `useEffect` to coordinate side effects from prop changes, it makes me feel like I'm reading a story written by Quentin Tarantino.

That being said, it's a relatively small complaint.

Re:The self-fulfilling prophecy of React by imbnwa on Friday September 09, 2022 @12:43AM (#32775391)
>I'm a big fan of hooks, but I'm still not completely sold on them. I like code that reads in logical sequence, like you're telling a story. When you use `useEffect` to coordinate side effects from prop changes, it makes me feel like I'm reading a story written by Quentin Tarantino.

I actually read this as a compliment considering Tarantino himself spoke in an interview about how his non-linear storytelling style comes from the way novels he'd read were written.