3 ms·
It is idiomatic JavaScript. If you learned Java at the university you'll immediately be comfortable with the code. Now consider React with hooks. It is neither
by petilon 4y ago
It is idiomatic JavaScript. If you learned Java at the university you'll immediately be comfortable with the code. Now consider React with hooks. It is neither OOP nor functional and it looks alien to anyone who knows idiomatic Java or JavaScript. Would you recommend a youngster learning programming to learn React? I wouldn't, because it is so frankenstein. This article makes that point better than I can: https://medium.com/codex/can-we-all-just-admit-react-hooks-were-a-bad-idea-c48120c5188d https://medium.com/codex/can-we-all-just-admit-react-hooks-w...
- ojkelly 4y agoJavaScript brings together so many paradigms, I can see strong cases for multiple different expressions of the language. We didn’t have classes until ES6. And they’re not real classes, they still use prototypical inheritance under the hood. If you want truly idiomatic JS, you shouldn’t be using classes. You should only be writing functions, and build your class-like objects with prototypes. On a practical level, I absolutely recommend new engineers learn React. The job market is enormous, it’s a skill the market still rewards well. And it’s a very productive framework. It rewards you for learning it, with better collaboration and velocity. I would say the same for the other major view frameworks too, but React still has the biggest job market. Until ES5, the industry thought JS was a Frankensteinesque monster. Until maybe 5-7 years ago, anything that wasn’t OOP was considered a bit weird. Calling any of these languages weird, is like policing English speech. We borrow so much from other languages that’s words have multiple meanings. Pronunciation follows contradictory rules, and regional dialects can be hilariously incompatible. There’s a few languages closer to French, which has a strict control on what the French language is. For example, Go. There’s really only one paradigm them, only one way to do things. Like it or not, pushing the boundaries of language design and framework design is how we improve as an industry. You can’t not like a new thing because it’s weird at face value. You risk missing the forrest for some moss on a tree, and being left behind. And sorry, that’s the same article this comment thread spawned from. I didn’t find it convincing at all, it’s let down by a lack of understanding in a few key areas.