The future of Mobile development with React Native

It’s time to change the mobile development world! It’s time to move on with the new way to develop mobile app, where we can do both Android, iOS and Web by using a single mindset and single language. But first let’s take a look in the traditional ways (from now let’s call them traditional!).

1. Need to express the same idea on different languages

This is like we want to say I love you with a Thailand girl and we need to say ผมรักคุณ instead. It makes sense in love but doesn’t makes any sense in software development. We have multiple codebases which basically for the same software, doing the same business logic. It basically violated the DRY rule (https://en.wikipedia.org/wiki/Don't_repeat_yourself).

I’m an Android Engineer. I used to learn to develop iOS and web app. And I felt so boring because I need to learn the different languages and APIs set to just doing the same things. I want to show a list of users, let’s see how I did that

  • Android
  • iOS

I’m 99% sure that iOS & Android platform engineers are copying the idea from others. But let’s forget about it first, it has nothing related to our topic here :)

Other than that, I also need to deal with the iOS and Android IDE layout system. Drag & drop UI elements is not easy like it should be.

This problem leads to a bunch of consequences, basically we need to do everything twice or more:

  • Develop a feature need to be done twice, on both platform
  • QAs and testers needs to test every feature twice.
  • Engineers needs to fix a bug twice.
  • Behaviours between Android, iOS, web app will likely be different because it’s done by different engineers.
  • … many more which you will see in your products.

2. Compilation time is f***ing long.

For large projects (many features, millions users) it should be around 2–3 mins (applied all optimizations we knew). It’s sometime enough for me to forgot what I just have done to verify. 30 times compilation can cost us 1 hour as well, imagine what can we do with our girlfriend in that 1 hour, yes it inside the section title above.

3. No standard way to do the standard things

I’ve been working in 3 companies. To show a list of items, people both have different ways. One used MVVM, the other one used MVP and the current one going with Clean architecture. There is nothing wrong here, it’s just hard to everyone to look at others code and understand what the hell is going on.

The future

There are many more problems. But let’s cut that session here first. Now let’s think about how can we solve them?

First problem, imagine that there are an iOS and Android guys to help us. All we need to do is we need to tell them what is the idea, then they will handle the implementation details for us. Problem solved!

This is what we currently have, our business logic is coupled with our platform logic:

With React Native, we can implement that business logic one time in JS side without touching any platform logic. It means that all the UI, UX user sees in their phone is platform specific.


Second problem, the only way to solve it is to not compile! Can we do that? Can, by interpreter.

Third but not last problem, life should be simpler and easier by React & Redux mindset.

More details, please!

We can solve all the problems above by using React Native. Take a look if you haven’t do so: https://facebook.github.io/react-native/

The big idea behind React Native is learn once, write anywhere.

What does it mean? It means we just need to learn once and use that syntax to write for both Android, iOS, Web and even in UWP (if it still there). React Native will build the platform which are the iOS and Android guys above. Also, they using Java Script, the compilation problem suddenly solved! But the biggest change here is actually about mindset, how can we build scalable app. Short answer: by Components with state & props. Long answer: https://facebook.github.io/react/docs/thinking-in-react.html

Shut up and show me the code!

First, let’s take a look at the todo app. See if it can blow your mind: http://www.reactnativeexpress.com/

We will discuss more on further post!

More document:

https://facebook.github.io/react/

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade