3 ms·
I find it's mostly the kids who like hooks, and the older devs who've been around since jQuery or further back, who dislike them.
by danielvaughn 3y ago
I find it's mostly the kids who like hooks, and the older devs who've been around since jQuery or further back, who dislike them.
- tshaddox 3y agoFor what it's worth, that's not at all my experience on the teams I've worked with. I was around when hooks were released and it was an immediate and significant improvement to our team at the time.
- Scarblac 3y agoI'm 49 and started with the Commodore 64, and function based components with hooks are so much cleaner than the old class based components, it's unbelievable. The classes had closely related functionality spread out over several different methods making them hard to understand at a glance, function based components are very concise. I think people who dislike hooks tend to overuse useEffect (it's rarely needed) and to do too much inside components rather than inside custom hooks.
- ng12 3y agoMy experiences with jQuery are literally the exact reason why I like React. I strongly suspect most HNers who are overly critical of React (and/or general web framework complexity) have never had to write and then maintain a large web application in jQuery.
- holoduke 3y agoJQuery is just a hammer. Its not a framework. It does provide utilities like selectors, events, triggers, dom manipulation etc. React is a component based framework. It contains pages, routes, state management, caching etc. You cannot compare those two. In a way jQuery is low level just above vanilla. Wheras react has a minimum of 500 execution layers. Thats why its slow and painful in many cases.
- toastercat 3y agoTo be pedantic, React is a library, and doesn't provide page abstractions, routes, or state management outside useState and useReducer. It also doesn't have very strong opinions about how you structure your application (what a framework does). That's what Next.js is for. I agree with your overall sentiment though.
- paulddraper 3y ago> It contains pages, routes, state management, caching etc. React does not have routes or caching. It has about as much management as jQuery.
- danielvaughn 3y agoNot talking about React, I’m talking about effects. Two very different things. I love React, I don’t love hooks or effects. I don’t think application state belongs inside the rendering machine.