I think I can understand the struggle of the author. I experienced JS as a non-robust / fast-moving programming environment. Frameworks, Buildsystems and Language Features that change every few month. So when I first heard, that React is the new thing and everyone should use it, I did not want to use it. I use React now everyday and I really like it. But instead of writing it with JavaScript I use ClojureScript with…
I tried a handful of times to get the same setup going but every part of the stack, from viable editor options, to the final output, is completely foreign to me. It's so much at once, I keep getting burned out after a day. Your comment has given me the urge again though :) It's going to click this time, I can feel it.
My struggle to learn React
141–150 of 218 posts
Re: My struggle to learn React
#142Earlier quoted context omitted.
What's the win to keeping up with it? Am I wrong that the problem it's solving is really pretty simple? I had the same problem with react-bootstrap, which I used for about a year and ran into regular upgrade compat problems. I wouldn't mind that much except that wrapping a React component around a fragment of HTML is not a problem so difficult that I'd endure compat problems in a dep to solve it.
> What's the win to keeping up with it? With the router, it was never a matter of us just deciding to upgrade for the sake of upgrading but rather ending up being painted in a corner with peer dependencies requiring upgrade. Additionally, because we were a micro service / many SPA outfit, we ended up with a dozen or more applications at varying levels of libraries so you had to deal with 2.x, 3.x, and 4.x or just upg…
It's possible react-router has settled down too, but the experience I had of "I can't believe I ever wasted time trying to figure out react-router" after implementing a "router" myself was so powerful that I'm pretty averse to finding out.
Re: My struggle to learn React
#143Earlier quoted context omitted.
React is just mapping data to XML, which may or may not end up as XML (React DOM vs. React Native). Throw in a component lifecycle, and you're good to go. Sure, it's not jQuery simple but for a modern SPA it's about as good as it gets. It allows you to just deal with things in terms of composed functions which is wicked elegant, and since you're almost surely thinking of your page and application hierarchically it ma…
> React is just mapping data to XML Nit: It maps it to a virtual DOM, not XML.
That it transpiles down to something else is just an implementation detail to the developer. For all I care it could be jQuery statements :)
Re: My struggle to learn React
#144Earlier quoted context omitted.
Why use jQuery when the native document.querySelector/querySelectorAll methods are available everywhere these days?
Cross browser/backward compatibility, especially IE...
Re: My struggle to learn React
#145He didn't even get to the part that I find confusing; the naming of things. componentDidMount? componentWillMount? Wtf is mounting? This isn't a goddamn harddrive. Props? Do you mean properties? or arguments? Wtf is a prop? Reconciliation? Portals? The fuck? And then, to top it all off, you can't just use React , you need to pair it with a set of other libraries, each with their own set of ridiculous jargon and parad…
If you think React is complicated stay far far away from Angular.
Re: My struggle to learn React
#146I've been doing web development for over 15 years, and I've seen a lot of trendy web application / UI frameworks that are going to be the The Final Paradigm come and go. That experience has taught me an important lesson about trendy framework stuff: If it doesn't make sense to a lot of people after a lot of thought, and there's a lot of rationalization required to plug that gap, it's probably not working out very wel…
This makes me think of an interesting/bothersome phenomenon I've seen a lot in web development (it seems to be more present here than in other domains—but I won't pretend to have any profound objectivity on the subject). People speak confidently about rationales for architectural decisions—and at first it sounds coherent and persuasive (especially paired with their confidence), but if you start trying to test it, considering specific cases, or more generally just drilling into the specific meanings of the very abstract statements—then you are likely to discover that the supposed rationale is really a justification.
I'm guessing this comes about because decisions about technology often have to be made with time constraints, and the time required to really investigate the set of viable alternatives exceeds what's available. So you're left with a partially completed search process, where the engineer has told himself a story about why choice X was the best, based on promising looking aspects of the search so far completed.
At this point, you're sort of committed to the decision you made, so you have to continue justifying it to yourself and others; and since there isn't necessarily a valid justification, the one you employ has to succeed in part through its obfuscation and your rhetoric.
Re: My struggle to learn React
#147This is a fine article. But I just want to say, as an alternate data point, my experience has been exactly the opposite . I love React. React is the first front-end technology I have ever managed to get to stick. * ES6 is just a detail, I know. But for me, ES6 transforms Javascript from an idiosyncratic scripting language where I constantly have to look up the ordinary way to handle basic programming tasks into somet…
Some unsolicited advice from someone who has also been down a similar path. I normally suggest eschewing the javascript class model in favor of using stateless functional components.[0] I've found them simpler to understand and it cuts down on unnecessary typing. I almost never use 'this' in javascript, and instead have favored an OLOO[1] or pure functional style as it fits into a simpler mental model for how things…
Re: My struggle to learn React
#148I've been doing web development for over 15 years, and I've seen a lot of trendy web application / UI frameworks that are going to be the The Final Paradigm come and go. That experience has taught me an important lesson about trendy framework stuff: If it doesn't make sense to a lot of people after a lot of thought, and there's a lot of rationalization required to plug that gap, it's probably not working out very wel…
Honestly, something like React/Vue has got to be as close as it gets to "The Final Paradigm". At this point, it's been a long time since I've seen a new paradigm that does anything vastly different or more productive and simple than JSX + React/Vue lifecycle & state hooks. Most of the new UI libs that come out (Glimmer, Marko, etc) seem to be heavily influenced by React and don't offer a giant leap in how UI is done.…
Re: My struggle to learn React
#149Earlier quoted context omitted.
Well, it really boils down to const path = findThePath(); class Router extends Component { render() { if (path === "/about") return else if (path.match(someRegex)) { const data = parseSomePath(path); return } else { return } } } Seems as though React Router has gotten a bit complex because it's abstracted away from the concept of a webpage, such that one can use it in the browser, or React Native (which can be a numb…
React Router v4 is particularly difficult to get used to when compared to earlier versions. While I don't much mind it (I get it working, then I don't need to touch it anymore), it definitely took me some time to wrap my head around it. So yeah, it works good when you get it working, so yeah, the best thing to do is to just buck up and learn if it you need it. But boy does it suck getting there. All of that said, I d…
That layout is the biggest reason it took me so long to understand it when my team brought it in.
It goes a bit against the spirit of Redux, but the tutorials really should pair up action and reducer in the same directory, then later explain why the other way is also useful.
We currently do this:
state/
|---some_piece_of_state/
| |------reducer.js
| |------actions.js
| |------tests.js
|
|---another_piece_of_state/
|------reducer.js
|------actions.js
|------tests.js
It ended up way, way easier to understand and get people in on it, because in the vast majority of cases we don't need multiple reducers listening to the same action.Re: My struggle to learn React
#150Earlier quoted context omitted.
>> But the point would be to start with the basics and build up an understanding of why we need these libraries. And what problems they solve and what problems they don't solve. This is exactly what the well-written official React docs do. It doesn't involve any CSS-in-JS, Redux, Thunking, Webpack, etc. 1) Start off with a basic app - build the Tic-Tac-Toe app through the official React docs 2) Build a simple React a…
Yeah, I guess I'm not giving the documentation enough credit here. The main issue I see is all the companies rewriting their applications in React. Because I don't think they see it as a complicated engineering decision with tradeoffs and potential issues. They see it as "we need x buzzword and y buzzword". I'd prefer that the documentation outright say "This is a BAD idea if you're just doing xyz" instead of "if you…
That's a good point - I wonder if devs think enough about when not to use the tools they build. I was about to mention that the Redux docs do this but the only thing I could find was the 'Before Proceeding Further' section on the first page. I think my impression came from Dan/Mark's tweets and articles, like this one: "You Might Not Need Redux" [0]. But even that article talks about all the benefits of Redux first :)
>> Also, is it just me or is the tic tac toe tutorial really not useful?
I agree it's contrived. Building a game I think is a good way to get introduced to working with state in a slightly more complex and interesting way. React is at its heart all about rendering a state machine. It's up to you how to represent that state machine - either as primitive state, context provider, or redux. Personally I'm not a fan of address book examples but that's just because I've seen so many of them they don't hold my interest...
[0]: https://medium.com/@dan_abramov/you-might-not-need-redux-be4...