3 ms·
We’re coming at this from different mental models. The code you linked is what React helped me get away from. There’s multiple files in different folders for o
by ojkelly 4y ago
We’re coming at this from different mental models.
The code you linked is what React helped me get away from. There’s multiple files in different folders for one screen. It’s hard to see how it composes, which is a useful boundary as it lets me know in the scope of that part of the UI.
UI is _hard_. There’s complexity that needs to go somewhere, and I’m one of those who prefer to push as much if it that isn’t business logic into a framework.
This becomes exponentially more important for every engineer you add. Go success is along these lines, with typically only one way to do things it’s much easier to share code.
From the code you linked, I could find my way around, but piecing it all together took a lot more work than any of the frameworks.
You mention only needing to know JS, HTML and CSS. But you missed that you still need to know how all that code is put together, what calls what. How it updates. React needs this too, the only difference with it being a framework is that knowledge transfers to a different project.
And to be clear, I’m not saying you need to use react or a framework—going your own way is often how amazing new things are found.
What I am saying is your attitude isn’t helping you here. React is still arguably the most used framework[0]. There’s a reason so many of us like using it and it’s what you described as “other crap”.
Frameworks help with collaboration, in the same way programming languages do. To do anything interesting with a general purpose language, you’re either going to use a framework, create a new one with good documentation and build a community of engineers around it, or build a halfbaked one that few people understand.
I’m open to other ways of doing things. It’s a good way to grow. I learnt SwiftUI a little while ago, and while I don’t use it regularly it improved my understanding of UI building. I learnt imperative UI API ages ago, and know for sure I want to avoid/contain that into a more manageable declarative approach.
[0] https://trends.builtwith.com/javascript/javascript-library/traffic/Entire-Internet https://trends.builtwith.com/javascript/javascript-library/t...
- petilon 4y agoIt 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.