7 Strengths of React Every Programmer Should Know About

Blog

7 Strengths of React Every Programmer Should Know About

cover img

In the past 6 years we have seen a huge rise of JavaScript on the web. JavaScript became a prominent server-side language, offline-first SPAs became a term, and JavaScript became a popular compile target for other languages.

JavaScript is finally conquering desktop and mobile platforms through hybrid apps and technologies like Electron or React Native.

In the past 3 years another revolution has started. Jordan Walke, a  programmer at Facebook, created React.js. React has since changed the way hundreds of thousands programmers write JavaScript code today.

These are the reasons behind React’s tremendous success.

1. Simpler Code with Fewer Bugs

React reduces user interface complexity, which is the single most powerful reason for its awesomeness. It is the first mainstream JavaScript framework built on the idea of functional programming. Which is awesome, because functional programming leads to code that is easier to reason about.

It is so much easier to debug! Avoiding side-effects and embracing immutable values make finding problems in your code an order of magnitude easier.

On top of that, the React community has built an amazing set of developer tools, e.g. a debugger that lets you travel back in time.

2. React Is Blazingly Fast

It is actually much faster than manually manipulating the DOM, which is the reason why Flipboard has built their own React-Canvas library to achieve 60fps performance on mobile web.

Modifying the  DOM after every change can be slow, therefore React creates a simplified JavaScript version of DOM called VirtualDOM and uses a diffing algorithm to apply only necessary changes onto the real DOM.

JavaScript is a reasonably fast language, and typical webapps consist of only several hundreds of DOM elements. React also supports efficient tactics to achieve 60fps even in much more complex apps.

3. It Plays Nicely With Your Existing Code

Facebook engineers designed React to integrate nicely with existing codebases. They have invested years into creating the Facebook site, so a complete rewrite just to be able to use React would not be justifiable.

It is really easy to use React with jQuery, Angular, Backbone or any other JavaScript framework.

4. Learn Once, Write Anywhere

Users spend 18x more time in native apps than on mobile web. Most products have to cover at least web, iOS and Android platforms to be successful today.

This usually means tripling the costs of software development as you develop and maintain each platform separately. In such diverse environment, it can be really tricky to provide a consistent experience for your users.

Hybrid apps might seem to be a solution. There is a lower barrier to entry, you can reuse your code amongst all platforms and it is much easier to maintain consistency with a single cross-platform team.

Unfortunately hybrid apps often don’t deliver a high quality user experience. And angering your users is risky business, because mobile users are unforgiving, which Facebook has learned the hard way.

React Native makes a real difference. You can create truly native apps with JavaScript and other tools you know from the web. React Native supports hot reloading, and tools like Reploy and CodePush can instantly deliver your app to customers and testers. Wondering about code reuse between platforms? Facebook shares 87% of the Groups app codebase between their Android and iOS platform.

5. Reactive Community Always Willing to Help

Facebook is going to great lengths to embrace community innovation. Speakers from competing technologies like ClojureScript, Cycle.js and Elm give talks at the official ReactJS conference. Some of the biggest innovations in React were actually inspired by ClojureScript, some were taken from Ember, and some came from Elm.

Whether it is ClojureScript, Elm, Angular or Ember, these great people are part of our “Reactive Community” and everyday remind us we should work together.

The React ecosystem is extremely focused on developer experience and productivity. The community has created an amazing number of tools and projects that help with writing better code. BabelJS, Redux, React Router, Immutable.js, React Native Playground, Flow, Relay, just to name a few.

Facebook itself has heavily invested into working with the community. They have hired the BabelJS and Redux creators, and invest resources into both projects.

Facebook is not the only big supporter of the React community. Yahoo, Mozilla, Airbnb, Netflix and other big companies use React in production and have supported community with useful open source libraries and tools.

loga

6. It’s still JavaScript

Elm, ClojureScript, PureScript and other great languages compete with React.js to be the coolest kid on the block. They all have interesting super-powers you can’t match in JavaScript. However, they have a much higher barrier to entry in the form of a completely new language and ecosystem.

React.js brings in revolutionary concepts, but it is still JavaScript. If you haven’t done much functional programming before, it is probably easier and safer to start with React.js

7. It Will Affect You Anyway. Better Prepare for That.

It is impossible to run away from the ideas behind React. Both Angular2 and Ember have adopted some key ideas from React and the idea of a virtual DOM has made an even bigger impact in the functional communities of ClojureScript and Elm.

React.js is not just a library, it is a phenomenon that has forever changed the way we program. Don’t miss the train. Start looking into it today!

Conclusion

React is changing the way we build web, mobile and desktop frontends. Thousands of programmers are experiencing an invaluable boost in productivity thanks to React.

It is not the perfect choice for every project. But it might help you on your project, and you will likely encounter it more and more often. It is definitely worth your attention.

Many thanks to @notbrent, @steida, @nikgraf, @jlongster and @rtfeldman for reviewing this article!

Samuel Hapák

Samuel Hapák

CEO of VacuumLabs. Follow Samuel at twitter for more...

Comments