My friends in the military should appreciate the Bottom Line Up Front: The answer is no, ReactJS is not a fad.
A better question might be: Why should I care about ReactJS?
The answer: simplicity with a nice helping of standardization.
Simplicity
ReactJS is deceptively simple. You write a function and it returns a DOM element, then the core ReactJS handles the details of rendering the DOM element.
No need to track a bunch of typed components (I’m looking at you, AngularJS, with your overly complex directives and state spread out all over creation). No strange interactions between components.
Just pure functions.
Standardization
ReactJS standardizes on the JSX mini-grammar for the DOM. It’s kinda like the AngularJS {{ … }} thing, so it’s familiar to modern Javascript programmers (and beats the heck out of other templating languages like DotNet).
But more importantly: ReactJS standardizes on the functional programming (FP) style. And this alone is great, simply because it eliminates huge swaths of Javascript syntax. No more ‘for’, ‘foreach’, multiple assignments to variables, and so on.
If you haven’t done much functional programming…it’s actually surprisingly easy to learn. In fact, Javascript is a great programming language to learn FP–much better than, say C++ or Java (and yes, you can write functional programs in those languages too).
Yeah, but…what makes you think it’s not a fad?
Developers and clients are starting to realize that functional programming in general, and ReactJS in particular, solves a set of really hard labor scalability problems.
After all, the most expensive software component is the one that’s hardest for humans to maintain. It has nothing to do with SLOC and everything to do with locality. To wit: if I can understand a module at a glance, it’s cheaper and thus better.
And what’s the biggest confounder for understanding a module? Well, it’s whether the module has “magic dependencies”. In other words: Does it reference variables out of its scope? Does it write variables that are used in other scopes?
I can tell you that I have never seen an imperative program that didn’t suffer from the locality problem. And why is that? Because imperative programs aren’t easy to standardize. Developers rarely even talk about eliminating dependencies in imperative programs.
But ReactJS and FP are explicit and opinionated about functions.
I could go on about managing complex state, but I’ll leave that to a later post. Suffice it to say that ReactJS should be in the arsenal of any contracting company that wants to keep development costs at a minimum.