Hacker News new | ask | show | jobs
by robotnoises 3333 days ago
"React is just JavaScript, there is a very small API to learn, just a few functions and how to use them. After that, your JavaScript skills are what make you a better React developer. There are no barriers to entry. A JavaScript developer can become a productive React developer in a few hours."

To me, this is the major driver of React's adoption and thus its success. Angular 1 took me a while to grok because there were so many moving parts. React's API is small and consistent a la JQuery, with the added bonus of being incredibly powerful.

2 comments

I've never seen someone being productive with react in a few hours, unless we're talking about very basic, static layouts.

Stateful components are still hard to write (but are useful!).

Component lifecycle is not trivial and has many traps.

Newcomers put the craziest things in render(): side effects, etc. JS or even TS has no way to enforce that render should just return a VNode and do nothing else.

Data management is very, very difficult (beginners use props and state interchangeably).

Using higher order components or generally writing reusable components with clean APIs is an art in itself.

Separation of concerns in React is tricky too, as the community like to say "everything is a component" and this again has many traps.

The concept of keys or in general, when a node is reused vs when it's destroyed/recreated is not easily understood by newcomers too. But you HAVE to understand that to do animations, etc.

Also, you're productive if you don't care about performances; Once you do, you will be much slower. shouldComponentUpdate, using immutable updates everywhere, not creating lambdas everywhere on each render (idiomatic react), using virtualized lists, etc.

Let's not pretend React is very easy. It only is fairly easy if you compare it to something extremely bloated like angular.

I guess it depends on what you mean by productive. I completed the React official tutorial in less than an hour and started writing a simple app, which then grew to a more complex app. Component lifecycle was trivial to me. There are only five or six lifecycle hooks. I was answering React Stackoverflow questions within a few weeks of starting.

Does React have some gotchas? Yes, but most of the time devs who get caught by those simply haven't read the very short and very good docs.

I've used loads of frameworks in my long programming career and React has been one of the easiest to pick up. Agreed that Angular is a bit of a nightmare. I studied that for months and still feel like a beginner even after building a side project with it.

I argue that React is only difficult because you have to unlearn a lot of bad "tricks". For me the hard part to learn was JS..

I only started JS development because React enables me to build UI software like i always have done, except now in a browser.

React is components 101 for use in browsers. Flux is business logic 101.

Both (React/Flux) are great for devs that have no prior experience with building normal desktop applications. And ideal for devs that DO have that experience. That is where the (non-early) adoption wave is comming from imho.

Productive as in "has produced something." I agree with bulk of what you're saying here, but my point was about barrier to entry, not being good or even great at it.
I suspected you meant that.

Just wanted to add some additional infos :p

It's fair to point out, considering that the general attitude towards React is that it's some panacea of simplicity, shining down from atop the mountain upon the unwashed masses. We still need developers in this world. :)
Thanks for clarifying. Parents comment was a little extreme. Also you have to include learning the front end ecosystem, webpack, Commons vs the other one, all the transpilation, react architecture which is diff from Js/jquery and even get into the.fluxes.

Jeff not a few hours.

Let's not kid ourselves - React is not jquery, by a long stretch. There is a reason why react developers can charge $100hr+ to do things effectively with react.

"Hello world" in react is deceptively easy, that is true.