Live data from Hacker News

React and Redux are a joke right?

games.greggman.com

41–50 of 119 posts

Re: React and Redux are a joke right?

#41
post #39
post #5

Earlier quoted context omitted.

Immutable.js is just another complication with another 60k size penalty with a few new negative drawbacks that he would need more complexity to solve. Author is already arguing against this approach.

Yep. I've been working with React for years now, over several large projects. I still feel like I'm not used to it, and I still hate it. That's not normal. We need to either figure out how to do this shit with mutable data structures, or we need a new language that's immutable by default. ImmutableJS blows chunks. Yeah it "saves" code until you start doing the data transformation dance trying to figure out when and w…

Did you say "immutable by default"?

fanfare, fireworks, etc

CLOJURESCRIPT!!

sorry I just get really excited when I can mention it ... I'll go now

Re: React and Redux are a joke right?

#42
post #33

tl;dr of this blog post: "Oh no, I don't understand how immutable data structures work and need to rant about why it doesn't make sense!" I don't want to be mean about it, but there's a lot of literature on functional programming and how mutable data complicates things as your states increase. The problem isn't how React forces you to write long code to get around immutability, the problem is the fact that you're try…

React feels like a library written for a language that's not JavaScript. JavaScript defaults to mutability by default - there are no immutable primitives that you can easily use, and even in ES6 just maintaining immutability without deep cloning everything takes a lot of effort. In that respect React is heavily opinionated.

Re: React and Redux are a joke right?

#43
post #3

Stopped reading half-way through, as lots of incorrect stuff off the bat. > In the react world though you can’t mutate your data Sure you can. > If you get 3 people react will end up re-rendering 3 times because of the code above. Each call to `setState` triggers a re-render. Nope, calls to setState are batched.

I think sometimes you need an outsider view to call out that the emperor isn't wearing any clothes, and that's going to result in botched details. I don't think it impacts the overall point the author is trying to make. I teach web development at a part-time course, and we recently redesigned our curriculum to use React + Node instead of Rails with JQuery. With the new technologies, the students are profoundly less p…

Has the complexity mostly come from React or from Node? I'm doing a small Node library from a similar but casual teaching perspective (all those manual middleware should be there by default IMO) so I'm quite interested in leaning your Node.js pain points.

Re: React and Redux are a joke right?

#44
post #15

>In the react world though you can’t mutate your data. Wrong, you're free to mutate your data. What's immutable is the virtual DOM fragment that a component maps the data onto. If you want to manipulate the DOM directly (and it can make sense), how about not choosing a virtual DOM/diffing library? >If you get 3 people react will end up re-rendering 3 times because of the code above. Yeah, because the code above is ob…

> I've found that deeply nested structures make it more cumbersome to write reducers for.

Well, that's kind of his point isn't it? It's no more difficult to update a deeply nested regular Javascript object. But it is more difficult to update a deeply nested Redux data store.

> Having said all this, the approach commonly taken by React/Redux is certainly not a silver bullet for every problem domain, but then what is?

I'd argue that Redux is not just "not a silver bullet", it's an arrow head shoved into the barrel of a gun. You might kill something with it, doesn't make it any good.

I agree completely with the rest of your points though.

Re: React and Redux are a joke right?

#45
post #3

Stopped reading half-way through, as lots of incorrect stuff off the bat. > In the react world though you can’t mutate your data Sure you can. > If you get 3 people react will end up re-rendering 3 times because of the code above. Each call to `setState` triggers a re-render. Nope, calls to setState are batched.

I think sometimes you need an outsider view to call out that the emperor isn't wearing any clothes, and that's going to result in botched details. I don't think it impacts the overall point the author is trying to make. I teach web development at a part-time course, and we recently redesigned our curriculum to use React + Node instead of Rails with JQuery. With the new technologies, the students are profoundly less p…

React + Redux has plenty of great principles behind it: functional approach to front-end dev, understanding the importance of one way data flow, components, immutable data stores etc. Also the separation of data from UI that allows rendering abstractions that result in React Native. There's a lot of material a good engineer should understand, and it's well thought out in React/Redux.

If you are trying to put up a few web pages quickly, then the learning curve is steep and it's probably overkill.

However, for complex single page apps with complex data that involve a team, then the payoff is huge. Especially with TypeScript (or other). The reliability, testability and extensibility of our complex applications is amazing compared to our previous attempts over the years.

Re: React and Redux are a joke right?

#46
post #33

tl;dr of this blog post: "Oh no, I don't understand how immutable data structures work and need to rant about why it doesn't make sense!" I don't want to be mean about it, but there's a lot of literature on functional programming and how mutable data complicates things as your states increase. The problem isn't how React forces you to write long code to get around immutability, the problem is the fact that you're try…

React feels like a library written for a language that's not JavaScript. JavaScript defaults to mutability by default - there are no immutable primitives that you can easily use, and even in ES6 just maintaining immutability without deep cloning everything takes a lot of effort. In that respect React is heavily opinionated.

Yeah, I guess that was a false statement. You're right.

Re: React and Redux are a joke right?

#47
post #33

tl;dr of this blog post: "Oh no, I don't understand how immutable data structures work and need to rant about why it doesn't make sense!" I don't want to be mean about it, but there's a lot of literature on functional programming and how mutable data complicates things as your states increase. The problem isn't how React forces you to write long code to get around immutability, the problem is the fact that you're try…

React feels like a library written for a language that's not JavaScript. JavaScript defaults to mutability by default - there are no immutable primitives that you can easily use, and even in ES6 just maintaining immutability without deep cloning everything takes a lot of effort. In that respect React is heavily opinionated.

"there are no immutable primitives"

Many array prototype functions work in an immutable way like map and reduce

Re: React and Redux are a joke right?

#48

Earlier quoted context omitted.

I think sometimes you need an outsider view to call out that the emperor isn't wearing any clothes, and that's going to result in botched details. I don't think it impacts the overall point the author is trying to make. I teach web development at a part-time course, and we recently redesigned our curriculum to use React + Node instead of Rails with JQuery. With the new technologies, the students are profoundly less p…

Then why don't you stick with Rails and jQuery? Modern frameworks like react (or even SPA alltogether) evolved for certain types of web applications (read that again: web applications, not websites). If your web application has requirements like offline funtionality (think mobile appstore deployment), very nice UI (think animations) or responsive UI (in terms of response times to clicks, drags etc.), you would not ge…

> Then why don't you stick with Rails and jQuery?

They're teaching classes about web development and trying to react to the perceived market demands.

You're talking here about "if you're building X or Y, use ABC", but the class doesn't make that call, and they're trying to be attractive enough to students to choose them.

If I was a student, and was looking to "learn web development", and I search around for what I should learn to make myself attractive to employers... I'm very likely going to find unbounded recommendations for Angular, React and Node, almost without exception. Probably not even 'likely' - it really is what I see touted weekly in many groups that I'm a part of (user groups, online forums, etc).

The current situation for new folks trying to get in feels like a big echo chamber with bad recommendations reinforcing poor choices leading to more confused (and less productive) jr devs coming in to the field.

Re: React and Redux are a joke right?

#49
post #39
post #5

Earlier quoted context omitted.

Immutable.js is just another complication with another 60k size penalty with a few new negative drawbacks that he would need more complexity to solve. Author is already arguing against this approach.

Yep. I've been working with React for years now, over several large projects. I still feel like I'm not used to it, and I still hate it. That's not normal. We need to either figure out how to do this shit with mutable data structures, or we need a new language that's immutable by default. ImmutableJS blows chunks. Yeah it "saves" code until you start doing the data transformation dance trying to figure out when and w…

Why don't Flow or Typescript count? Our team uses TypeScript, mostly C# devs, it's been great. The main issue getting definitions for some less common libraries.

We haven't been using immutability.js because of the back and forth overhead between regular JS and immutable objects. Instead we use mutation checking of the Redux store during development you can make sure nobody is stomping on it by accident.

Post reply on HN