Live data from Hacker News

How I learned to stop worrying and love React

firstdoit.com

1–10 of 107 posts

Re: How I learned to stop worrying and love React

#3
Nice overview, I like how the article has the same code demo in Knockout and Angular to show how they both solve the same problem in slightly different ways. Would be nice to see the firstName + lastName demo in React too, I know the onChange stuff can be a little verbose, but would be good to show how it can be used to actually update a single central model.

Re: How I learned to stop worrying and love React

#6
I recently worked on my first React project, after working with Angular code for a while. I'm willing to accept that as an app gets more complex, React/Flux really pays off. But there's something to be said for having a single template file for a single page in Angular, versus having JSX scattered among 20+ components for that same single page in React. When you want to get a 10,000-foot-view of how it all comes together, you can (generally) do that in the code in Angular, but you're better off doing it in the browser with React. Which may not be bad, but it's a difference worth mentioning.

Re: How I learned to stop worrying and love React

#7
post #2

Wow, author here. Woke up to a lot of unexpected traffic on the blog. I hope you like this article. I took a long time to understand React and, now I do, I hope other people don't take as long as I did!

Nice work. Hopefully you can write another one about Flux? :)

Re: How I learned to stop worrying and love React

#8
> However, all template languages are inherently crippled: they can never achieve the same expressiveness and power as code. Quite simply, {{# each}}, ng-repeat and databind="foreach" are all poor replacements for something that is native and trivial in JavaScript: a for loop.

On the other hand, when using a template language I can put `foreach` loops and `if` conditions right into the template itself. And when using JSX I need to calculate the result of a `for` loop before the actual template and it looks much more complex and cumbersome.

Re: How I learned to stop worrying and love React

#9
post #6

I recently worked on my first React project, after working with Angular code for a while. I'm willing to accept that as an app gets more complex, React/Flux really pays off. But there's something to be said for having a single template file for a single page in Angular, versus having JSX scattered among 20+ components for that same single page in React. When you want to get a 10,000-foot-view of how it all comes toge…

> But there's something to be said for having a single template file for a single page in Angular, versus having JSX scattered among 20+ components for that same single page in React.

Good point; How does one view the resulting react-page anyway? CTRL+U shows no matter what state the SPA is in..

Re: How I learned to stop worrying and love React

#10

> However, all template languages are inherently crippled: they can never achieve the same expressiveness and power as code. Quite simply, {{# each}}, ng-repeat and databind="foreach" are all poor replacements for something that is native and trivial in JavaScript: a for loop. On the other hand, when using a template language I can put `foreach` loops and `if` conditions right into the template itself. And when using…

Which is why I prefer Ractive.js to React.
Post reply on HN