Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I think many of the "advantages" of ReactJS are just hype

- Immutable data, one directional data flow are easier to learn, understand, harder to break etc. - This isn't anything new, these are just concepts taken from declarative programming. You could always have used those concepts in your JS. They aren't better/worse than imperative programming. That's like saying Haskell is better than C++.

- Two-way binding creates infinite loops! - Umm... not if you're a half-decent programmer. I've worked with complex single page apps for years, even with junior developers, it's never been a problem.

- ReactJS is so much faster - Only in unrealistic benchmarks as this illustrates (Mithril is faster in those benchmarks BTW)

React also has a few major downsides:

- JSX breaks your IDE's error checking and line numbers in error messages (and not using JSX is a pain/verbose)

- Being only the V in MVC leaves out too much. Now you have to patch together a URL router, http/socket communication script, custom solution for managing the model, etc.



Routing, http, and models aren't hard problems. Blaming React for not being an entire MVC framework is silly. It's not designed to be, and there are any number of ways to solve that problem.

Being able to use it with ANY different set of solutions for MC is especially good. I can use React for UI on top of old jQuery pages if I want to. I'm not forced to change my entire application to use it.

Decoupling is a really, really BIG benefit, not a downside.


.. until you're building a problem that requires regular external security audits, and you have to keep up with all of the micro-libraries you're using and any security issues they may or may not have. The Angular team has been very responsive to any security issues that have come up, and you get so much for free by using the framework.


models aren't hard problems?

OK, then show me a js model system that does one-to-one, one-to-many, and many-to-many relationships — while still having clear, concise and understandable code.


> JSX breaks your IDE's error checking and line numbers in error messages (and not using JSX is a pain/verbose)

Source maps. Unless you aren't using any form of minification or bundling at all, you need them even if you aren't using JSX.


The most interesting thing to me is that React's virtual dom implementation, according to http://vdom-benchmark.github.io/vdom-benchmark/, is generally the slowest of the bunch. You could pretty much move to using anything else and have a faster vdom implementation and smaller library. Additionally, many out there are so similar to writing React that I don't see how using React is a win over the alternatives. In my own experience on my machine, the dbmon example in this article for Angular is significantly outperformed by the likes of cito+t7, http://t7js.com/dbmonster/precompiled.html. Angular shows roughly 6fps topping out at 6.7 for me, while t7 is showing roughly 13fps topping out at 13.8. I don't know about anyone else, but 100% more performance isn't trivial.


React might be slower but it is more battle tested against multiple browsers than other vdom implementations, any vdom implementation might have to take performance hits to support older browsers like Internet Explorer 8



Nice, cito.js shows really nice performance.


I just smelt a load of prejudice here. Leave alone the technique detail(holding a debate which is better - Angular or React and here goes your rest of the day), IDE/error checking stuff isn't a problem anymore. Maybe you should try eslint, babel-eslint, babel-sublime or anything emerge since 21 century.


> That's like saying Haskell is better than C++.

But.... it is.


I have to disagree especially with your last point. I just use React to render the UI not to replace the entire backend application with JS. For that, React is perfect.


I don't tend to think ReactJS has many advantages, just differences.

Angular 1.x is optimized around creating pages, where as React (and Angular 2.x) are optimized around creating small components.

Angular 1.x uses two-way bindings by default and you can opt into one-way bindings. React essentially does the opposite.

I have had infinite loops pop up in Angular, just by having floating point numbers that don't "settle" down to the same value. Also, it is too easy to end up with to many watchers on a page.

Also, Angular is a much more complete solution than React but I have found react-router and the fetch api get me 80% there.


one-time bindings are not the same thing as one-way bindings.


> - JSX breaks your IDE's error checking and line numbers in error messages (and not using JSX is a pain/verbose)

JSX doesn't break line numbers in error messages because JSX to JS transform preserves line numbers.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: