Re:Ask HN: Tell me about how you bombed a technical interview
by geraldwhen on Saturday April 08, 2023 @03:12PM
(#35496581)
The fact that it’s unintuitive and different is why hooks are a joke. Class components just make sense.
[ Parent
| on HN ]
Re:Ask HN: Tell me about how you bombed a technical interview
by zinckiwi on Saturday April 08, 2023 @03:24PM
(#35496686)
I never had a problem with the explicit lifecycle methods in class components, and the concept of a functional component effectively being the render method in isolation. To me there’s only one clear advantage to hooks and that’s sheer reduction in raw lines of code. Having said that, it’s a pretty huge advantage for something like redux.
Re:Ask HN: Tell me about how you bombed a technical interview
by 1attice on Saturday April 08, 2023 @03:23PM
(#35496680)
TBH I disagree, I prefer strict functional programming, mostly for composability. Class components feel like translating everything into latin numerals and then back out again.
Hooks help me avoid that pain. But is the API perfect? Nope.
Re:Ask HN: Tell me about how you bombed a technical interview
by mpeg on Saturday April 08, 2023 @03:41PM
(#35496858)
There are also frameworks like solidjs which have similar syntax to React but avoid the complexity of hooks with a simpler API and no hook rules. Classes are not the only solution
Re:Ask HN: Tell me about how you bombed a technical interview
by 1attice on Saturday April 08, 2023 @04:00PM
(#35497013)
Lately I've been investigating Svelte. It looks really good, but I think I'm going to stick with React/Nextjs simply because of the ecosystem and switching cost.
Again, this isn't 'American Idol for frameworks'; I'm not picking React because I think it's the best, or even better. I'm picking React because of the habitat, and because that habitat is now, in a sense, my hometown.
Re:Ask HN: Tell me about how you bombed a technical interview
by mpeg on Saturday April 08, 2023 @04:30PM
(#35497303)
Yeah of course, you always have to do what is best for your company/clients and React is always a great choice (can't beat the ecosystem)
It's the same reason why I non-ironically recommend Wordpress to a lot of people that have super limited budgets and want the moon.
I do enjoy trying all the different new approaches to UI development though, especially as I'm not a frontend developer so most of the time I write frontend code I'm building either internal tools or personal projects, so I get to experiment a lot.