React Native Is the Way of The future
React Native may well be the answer to programmers’ longstanding prayers especially in building apps for mobile platforms.
The dream of all software developers is to have a fun, easy language that provides a fast track to completion, easy to debug and performs well on the targeted platforms — ideally as a native app, instead of an interpreted or emulated one. The result would be that ideas for a finished application become a reality much more quickly and which are not at all sluggish in their responsiveness on any of the intended devices.
For those who are not software engineers, “native” simply refers to software that is pre-compiled (translated) into the machine code (the instruction set) that is indigenous to a specific device. Native code typically runs much faster than programming code that has to be interpreted and then converted to machine code on the fly. Native is also faster than imported native code from a foreign device that has to be emulated locally. All that translation slows things down.
It used to be that accessing the internet required one application and the same device that ran that software had many other applications that took on other tasks. More and more, the line between internet access and other applications has been blurred. The Internet of Things is part of this revolution.
With the development of mobile devices, each with their own unique operating system, the landscape of development became more complicated. It seemed software engineers were going to have to learn multiple operating systems in order to develop cross-platform applications — more so than ever before.
But React Native seems to be the new lingua franca of software development, allowing software engineers to learn once and to develop for many platforms.
It Started with React
Personally, I like getting my hands dirty with assembly language on occasion (one step away from machine code), but building a full-blown internet app in assembly language could take several decades of labor. By the time you’re finished, your approach would likely be sorely outdated. Programming languages have become more and more abstract and high-level, wrapping all those machine-level details into more generalized code that is easier for human programmers to understand, and far easier to debug.
React Native does not rely on HTML5. Instead, it includes a native layer to build an application for iOS and another one for Android, each of which works directly with those operating systems, rather than through intermediary web or hybrid approaches. This makes React Native apps far more efficient and the look of the app on each device far more like other apps on the same device.
All of this is achieved without the far longer development time required for building apps in the native environment. Development time drops from months to hours. Why the difficulty developing natively for mobile? One key element involved laying out a page, requiring manual calculations for each necessary view. Such tedium can slow down development to a crawl. One of the old maxims of software development is never to hardcode values and this is just as bad; scalability of the engineering process was severely curtailed. Making incremental changes in an app had the added tedium of requiring a full recompile every time you made the tiniest little change just to see if it worked. In web development, you only needed to change the appropriate code and then refresh the web page in the browser to see the results. React Native eliminated these problems through bypassing such tedious details.
And there are other benefits from React Native. Facebook software engineer, Tom Occhino, explains, “What we’ve found is that when we build with React, our code is a lot more predictable. This predictability makes it so we can iterate more quickly with confidence, and our applications are a lot more reliable as a result. Additionally, it’s not only easier to scale our applications when they’re built with React, but we’ve found it’s also easier to scale the size of our teams themselves.”
The Big Reasons for Going Native
The user experience (UX) is king in software development. If a user gets frustrated, even in the slightest, an app could be removed and forgotten. If an app looks clunky or oddly different from other apps on the same platform, that adds to the level of annoyance. Going native in app building means that the look and feel are more compatible with the platform.
Going native means that a developer can use all of the UI tools that come with the platform — things like date pickers, navigation stacks, switches and maps. Creating a web version of these components is never quite the same and the user is going to notice. Moreover, when changes to these things are made on the platform, your web versions are never automatically updated to match. With a native app, the updates are automatic and seamless.
When an application needs to crunch numbers, it usually does this in the background on a separate processing thread. This allows the front end (user interface) to remain responsive to the user’s clicks and typing. Without such multi-threading, an interface would hang and the frustrated user might take the software behavior as a sign of disrespect. Wouldn’t you if someone ignored you while you were attempting to communicate with them?
Web development doesn’t have the multi-threading capabilities of native apps. But with React Native, you can tap into each platform’s multi-threading capabilities. This way, the user stays happy while the app is busy crunching numbers in the background. What kind of crunching? One is decoding images in order to display them. Another is text measurement. By going native, an app can remain high performance and responsive.
React Native takes care of all these problems. Facebook’s Occhino explains, “Since React components are just pure, side-effect-free functions that return what our views look like at any point in time, we never need to read from our underlying rendered view implementation in order to write to it. In the browser environment, React is non-blocking with respect to the DOM, but the beauty of React is that it is abstract and not tightly coupled to the DOM. React can wrap any imperative view system, like UIKit on iOS, for example.”
In the last three years, React Native has expanded from iOS to include Android and Windows 10.
Some have voiced concerns that Facebook could, at some future date, abandon React Native. But this seems unlikely, even if they find some aspect of the technology to have unforeseen problems. Facebook has made the project Open Source which makes it more of a public project with the potential to live on even if its creators lose interest. So far, React Native is living up to the expectations — keeping development lean and fast with results that feel like real, native apps written in Java, Objective-C or Swift.
Ready to take the next step, and launch your MVP? Drop us a line. Our team of ex-Googlers can help you every step of the way, from design, to engineering, and all the way through product-market fit.