App programming uses React Native, compared to Android / iOS

Two years ago, I focused on native Android programming. But last year, when the company asked me to learn iOS programming, I was quite excited at the beginning, but that spirit quickly faded away, my productivity also decreased. I realized, I have to learn everything from frameworks, tools, IDE … from the beginning, and because I really like to meetup sessions, I also started attending meetups sessions of both Android and iOS. I need to update with the latest features on both platforms, so it is time consuming and frustrating when my learning ability is not fast. So I was very excited when React Native for iOS was born.

What is React Native?

React Native is a technology created by Facebook, allowing developers to use JavaScript to make mobile apps on both Android and iOS with native feel and interface. An example to clarify how React Native works is the wrapper of native code. There are many elements that are created while wrapping – "wrap" the native functionality of iOS or Android. React Native has gained a lot of traction since its launch since it has changed the game fundamentally in many ways.

Two ecosystems

One reason mobile app programming is so difficult and time consuming is because you really need to learn two completely different ecosystems. If you want to program an iOS app, you must learn Swift or Objective-C and Cocoa Pods. If you want to program Android apps, you need to learn Java and Android SDK. I have written code in three languages, Swift, Objective C, and Java, and are not really interested in debating which language is better. However, what I can say is that they are different and learning each of them will take a lot of time. The same thing happens with frameworks: Cocoa Touch and Android SDK. Of course, every frameworks always have a package of tools like testing tools, libs, packages … and it is indisputable for devs to update the latest features of each ecosystem.

On the other hand, if you choose to program on React Native, most of the time you'll just need to learn a set of tools. There are a lot of things to get used to: JavaScript, Node, React Native … but there is only one tool to learn.

Reusable ability

Usability plays an important role in software programming, so whenever you can reuse code, React Native is a good tool.

React Native doesn't just write once, it runs the platform everywhere. Whenever you program an app, you need to build a native-looking UI. For this reason, some UI code needs to be written in accordance with the best guidelines and standards of that platform. However, there will always be some common UI code that can be shared together with all logic. The "code-sharing" feature has many advantages such as better utilization of human resources, less code maintenance, fewer bugs, similar features in both platforms …

Learn once, write everywhere
When Facebook's team created React Native, their goal is to help developers learn once but use every platform. Because all Android and iOS code use the same toolkit, the idea of ​​having a dev team is an app for both platforms that is possible – a rare thing when there is very little dev programming both platforms. iOS and Android. Even, I think that the team building the web app using React.js will not be extremely miserable when learning to program React Native and start making mobile apps.

Declarative API

When you create an application using React Native, it's easier to predict and understand your UI because it has a declarative API, in contrast to imperative APIs. The difference between these approaches is that when you have an app with many different states, you need to keep track of changes in the UI and edit them. This can be a complex and unpredictable task when your app grows. This is called Imperative Programming. If you use React Native that already has declarative APIs, you only need to care about the current UI status that looks like this, without tracking the old UI.

Hot Reloading

The usual habit of dev when code is to test changes every time the code is written. To do this, the app needs to be aggregated and installed either in a simulator or a real device. With React Native, most of the time, you don't need to summarize the app every time you change. You just need to refresh the app in simulator, emulator or device. There is even a feature called Live Reload to automatically refresh the app every time a change is detected in the code.

Open source

React Native is still a very new technology, just becoming an open source less than a year ago. There are still some bugs, but in general, developers can use React Native at the production stage in most mobile apps. There are still a few features available in native frameworks, which are not available for React Native, but this is not a big deal. From my own experience, this is only a simple thing when you are familiar with native programming. Plus, since React Native has been an open source, a large community of dev has helped implement more features, fix bugs … Most of the time, if you're trying to program something familiar in mobile apps it is most likely programmed.

As you can see, I'm really optimistic about React Native. I still remember programming Android and iOS native but at the same time excited about using React Native last time. I think React Native will be a game-changer – a game changer in mobile programming and hard to wait until it becomes a platform not to be missed for mobile programming!

ITZone via IDE Academy via Packtpub

Share the news now