
Why is React is taking over front-end development? - lucaspiller
https://medium.freecodecamp.com/yes-react-is-taking-over-front-end-development-the-question-is-why-40837af8ab76
======
robotnoises
"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.

~~~
boubiyeah
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.

~~~
robotnoises
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.

~~~
boubiyeah
I suspected you meant that.

Just wanted to add some additional infos :p

~~~
robotnoises
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. :)

------
robodale
I'd argue Vuejs is rocketing toward Reacts leadership position:
[https://trends.google.com/trends/explore?q=reactjs,vuejs](https://trends.google.com/trends/explore?q=reactjs,vuejs)

~~~
mulrian
This is more representative
[https://trends.google.com/trends/explore?q=%2Fm%2F012l1vxv,v...](https://trends.google.com/trends/explore?q=%2Fm%2F012l1vxv,vuejs)

~~~
rmccoy6435
I'm not sure I wholeheartedly agree with that. The YouTube channel "REACT"
could be driving some of these numbers. There's a spike in early 2016 that
made me think of it - remember the whole 'REACT' Trademark craze? The
Stackoverflow Trends blog post [0] from yesterday is probably more
representative.

[https://stackoverflow.blog/2017/05/09/introducing-stack-
over...](https://stackoverflow.blog/2017/05/09/introducing-stack-overflow-
trends/)

~~~
Kurtz79
Try changing the timescale to 3 months or so for react, you get a nearly
perfect pulse wave with peaks on weekdays and valleys on the weekends.

The same happens with Javascript, Java and I guess most (popular) programming
languages; it might be an imperfect indicator, but one that suggests people
are actively searching during their working hours (which I don't think applies
to the youtube channel).

------
j_m_b
> React is a JavaScript library. It’s not a framework.

This is an extension of the UNIX philosophy: do one thing, right. React
developers state that "React is the V in the MVP model". React can easily be
integrated with any other JS library that is out there. This is very
attractive to developers.

Facebook in general seems to be moving in the functional programming direction
with tools like GraphQL. React is a functional approach to UI development. It
also makes use of the concept of immutable data. The functional programming
paradigm has been gaining traction lately and React seems to be riding along
with this wave.

As React is functional, simple and makes use of immutable data, it was quickly
adopted by the Clojure community. It has two major adaptations, React and Om.
I imagine other functional programming groups have gone in a similar
direction. This also could be helping propel it along.

~~~
crimsonalucard
Does the unix philosophy require web pack and a complex compiler tool chain to
get it to work? Is Compiling one language into another part of the philosophy
as well?

React is not functional.

~~~
j_m_b
>Does the unix philosophy require web pack and a complex compiler tool chain
to get it to work? Is Compiling one language into another part of the
philosophy as well?

In terms of the GNU system, they usually require autotools, make, gcc and
binutils to compile. The code is translated along the way into a binary that
matches the local format, such as ELF or Mach-O.

------
ChrisCinelli
React came with a nice and small interface that work well with the DOM. It was
pretty innovative and solved one of the biggest pain points.

I agree that because it just works on the View, it has been easy for people to
adopt it.

The support of Facebook helped to make it shine in the "a new frontend
framework a month" reality. Now the great documentation, great articles and
great component already built for you make React a very compelling piece of
software to use.

At the same time I agree with who says that today if we look only at the
simplicity of the interface and performance, there are a few better libraries.

MarkoJs and Vue for example.

~~~
seangates
+1 for MarkoJS. Approachable, isomorphic, stateful, and FAST.

------
hjnilsson
Is it? Google Trends shows about twice the interest for Angular vs React [1],
which is not an insignificant difference. Is there strong evidence to indicate
that React is 'taking over'?

[1]
[https://trends.google.com/trends/explore?q=%2Fm%2F0j45p7w,%2...](https://trends.google.com/trends/explore?q=%2Fm%2F0j45p7w,%2Fm%2F012l1vxv)

~~~
skeeterbug
If you have a simple, well documented library, is there a reason to search on
it as often?

~~~
robotnoises
That's a fair point. ng1's docs were somewhat lacking, too, which I reckon
drove a ton of traffic to sites like Stack Overflow and Google in general.

------
hypercluster
Okay I go ahead and say it: I still like Angular 1.x

I feel like there's a lot of hate towards Angular and much praise for React.
Personally I don't get along with the syntax and just the readability of React
code or rather the structure. But that may just be my lack of experience with
it.

I understand that the DOM diffing in React is superior but.. is it really that
important? For me the two-way data binding of Angular takes away the headaches
of doing updates with jQuery. Sure, I get that having to follow the "Angular"
way and wrapping foreign libraries is overhead. But it still feels adequately
simple to write applications with it.

------
samsonradu
> 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.

This is a valid point. Maybe not a few hours but it clicks with developers
after a few days. But then there is also the very good documentation and an
already big community. Also Facebook backing it is encouraging for mid-sized
companies to use, which don't expect breaking changes any time soon.

------
hyperpallium
Because every few months, something takes over web developement.

~~~
pmarreck
See: why I went to the backend.

Things are more static, and more easily automated-testable.

~~~
onion2k
One of the big advantages of React is that it's straightforward to unit test
your components. Plus there's Jest, which makes a lot of the hard bits of
testing much easier.

(I say this as a developer who mostly uses Angular and Vue rather than React.
I wish I had the React toolchain in other frameworks.)

~~~
pmarreck
How would I run a React unit test from the command line? Or would I have to
run it in-browser? Any pointers would be welcome

~~~
onion2k
Jest uses jsdom. You just need to add it to a project ("npm install --save-dev
jest"), write a spec, and then run npm test (maybe update package.json to have
'jest' as the test command). It's really, _really_ easy.

There's even a repl so you can try it in a browser first -
[https://facebook.github.io/jest/#use](https://facebook.github.io/jest/#use)

------
awjr
I think the title is slightly wrong. "Why is React better than plain
JavaScript DOM manipulation?" might be a better title.

I was hoping for a more indepth analysis of industry trends around different
JS UI frameworks.

------
crimsonalucard
There is rarely a logical reason for why something is taking over front-end
development.

Take javascript for example. Let's face it... javascript is a shit language.
Why did it take over front end web development? Because of Logic? No. Why did
React take over front end web development? Because of Logic? Maybe.

The react + redux ecosystem has major issues that need to be addressed.

Problem #1: complex tool chain.

Problem #2: Forced OOP. Components need to be objects to use this.setState().
Why is this design necessary? See cycle.js.

Problem #3: redux... functional programming / immutable programming is not
necessarily the best choice for a Model in any architecture that contains a
model (MVC). Try building an app with a complex tree structure for the model
then update a node in the middle of that tree and see what immutability does
for you... Welcome to the world of Zippers and lenses..

In fact View components should be immutable and the model itself should be
mutable... In react + redux it's the other way around!

We can do better. React + redux are not the holy grail.

~~~
crimsonalucard
Just want to mention. Does it make sense for a model in the backend to be
immutable? Imagine that... Immuteable mysql... Why does this make sense on the
front end? Why? Why? Why?

~~~
iLemming
You ever heard about Datomic?

~~~
crimsonalucard
Nope. What about it?

------
sebringj
My perspective is React was always very simple and I use React Native and
React so it is easy to transition between them. My focus then becomes on
getting actual things done.

------
acdha
“React is just JavaScript”

That's like saying Windows is just C/C# – it's technically somewhat true but
over-simplified to the point of being useless.

------
dowrow
Vue < React < Angular Hacky micro-frameworks are not the way to go for big,
serious, retro-compatible apps developed by big distributed teams.

~~~
tchaffee
Does Vue allow you to use only javascript like React does? After getting over
my initial resistance of using javascript as my "templating language" I am
kind of done with frameworks that try to make HTML into a programmable
language.

~~~
Kiro
Same and I'm using Vue in production where the template has become a complete
mess very similar to what happens in Angular 1 applications.

