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

It's not hard to be faster than React, React's performance benefit comes from the fact it makes performance easy to understand and optimise rather than just being magically (but opaquely) fast.

However, the real reason React is a good choice is not performance, but rather how it encourages developers to think about, isolate and better manage mutable state in their applications.



100% agreed. Working now on angular app at work (not my choice) I see state flying everywhere which will inevitably lead to something awful. The argument to push it back into a main controller and let it flow downward only seems completely unrealistic if not impossible and the api certainly doesn't encourage it at all.

Meanwhile in Clojurescript I have undo functionality without thinking about it - mind blowing because it's something I never expected to see in a web app without much pain.


Correct. But React is also a step behind ClojureScript based React wrappers :) like Om and Reagent.


Could you explain why are they step ahead? I am not familiar with ClojureScript, but my interest in it is really high.


Because Clojurescript uses immutable data structures, and keeps the state in a centralized atom, so comparing different states is as easy (and fast) as comparing the different versions of the data structure, which in turn (and thanks to being immutable data structures) reduces to compare their memory references, which is fast.


Immutable.js is a project also from FaceBook that brings immutable data structures to your JS applications including those using React.

Since Clojurescript compiles down to JS, wouldn't it be possible to use Immutable.js and a slightly different app design (a single Flux Store for the entire app) to get the same benefit of using React with Clojurescript?


The centralized immutable state oriented architecture advocated by Om can definitely be implemented using plain JavaScript (my favorite in this space is https://github.com/moreartyjs/moreartyjs), but language features like core.async, transducers and macros are not so easily replicated.


Nitpicking but ClojureScript the language does not keep state in a centralized atom. That's just a common pattern used for Reagent/Om apps.


Centralized state as an immutable data structure is exactly how the app I work with is built. It's plain JavaScript and React. So I don't see how React is "behind" on this front.


Nuclear.js also does this, with pretty idiomatic JavaScript


This is a slightly long read, but it will give you a feel for it: https://github.com/Day8/re-frame

(disclosure: I am the author)


care to share how react is transparent?

it's completely opaque on how it decides to re render the dom. unless you only have react code there, it's completely dark magic for other code




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: