After I went React (Native), I couldn’t go back — Part 1

Kenza Iraki
Samsao
6 min readNov 28, 2017

--

In the past few months, the lines around different developer job titles at Samsao have been getting blurrier and blurrier. While I started as an iOS Developer, I now also write apps in React Native, write backends in Node.js, dabble in Ruby, DevOps and even web development. We are moving towards a more versatile engineering team, and I believe that’s an amazing step forward.

While I believe React Native still has ways to go before it can be considered a complete replacement for native mobile development, I think it’s getting closer and closer to that goal every day. For a framework that’s only a couple of years old, and which hasn’t even reached version 1.0, it’s doing quite an outstanding job at providing developers and business with the tools necessary to make cross-platform, highly performant apps, which, if done properly, can hardly be differentiated from entirely native apps.

Under the hood, React Native calls native functions and views, this is what differentiates it from other technologies like Cordova or Ionic, where entire apps are embedded inside webviews, and as a result lead to poor user experiences. In React Native, a <Text> is a UILabel in iOS, and a TextView in Android. Its similarity to native development is what makes it such an attractive option — a promise to build apps just as good, but in half the time, by allowing developers to use one codebase for both platforms. While that may be true for businesses, I believe React Native’s appeal to developers lies in one of its less publicized aspects: how different the development experience is, compared to native iOS and Android.

Now, having never truly worked on any Android app, I can hardly vouch for how much better or worse the developer experience is compared to React Native, so I will abstain from commenting on it.

One important thing to know is that I am a self-taught developer, whose first programming experience was iOS Development. That means that before I started developing React Native apps, the only languages I had touched upon were Swift and Objective-C, and the only development ecosystem I knew was iOS. And while I was annoyed by Apple’s lack of flexibility, Xcode’s bugs and the infinitely long Swift compile times, it was really all I had ever known. If I hadn’t been asked to learn React Native at Samsao, I would have been fine working in that environment for probably a very long time.

My goal in writing this blog post is to discuss the pros and cons of React Native, from the perspective of an iOS Developer. I won’t go into detail about the features RN (React Native) provides, or the features it lacks (this will be for another time), the real purpose here to compare the developer experience.

In short, am I happier writing apps with React Native or iOS?

Note: As this blog post was getting quite long, I chose to split it into 3 parts, which each comparing a specific aspect of development. Part 2 will be published in a week, and Part 3 the week after.

Round 1: IDE

Native iOS

There are not many IDE options if you want to develop native iOS apps. Xcode is by far the most widely used software, and even those who’ve grown tired of it and started using JetBrain’s AppCode end up having to revert back to it quite often. The bottom line is that you can build full fledged iOS applications using Xcode only, but you will not be able to do the same with AppCode. For this reason, I will only comment on Xcode’s developer experience.

In one word? It’s terrible. For an IDE built by the most profitable company in the world, it’s disappointing to see the amount of bugs in it, even after the 10 years Apple has had to improve it. It’s often extremely slow, reports errors in your code when there aren’t any, crashes frequently for no valid reason. I stopped counting the times where I had to stop my work for a whole day because Xcode decided to start crashing, and I had to spend hours uninstalling and reinstalling it.

These are all pretty bad points, but to me the worst aspect of Xcode lies in its lack of flexibility. What do I mean by that?

On almost any code editor, even the simplest ones like Sublime Text, there are plugins. Plugins are amazing because they allow developers to add tools to their code editor, that the team behind that editor may not have the time to write otherwise, such as code formatters, support for a variety of languages and custom commands. In Xcode, there used to be plugins, but then Apple decided they were a security risk, and released a version that did not support them. Unfortunately, sticking to older Xcode versions is not really an option if you want to support newer versions of iOS.

To add to that, there’s the way Apple deals with Xcode bug reports and feature requests. Let’s say you found something wrong with the latest release of Xcode, it crashes every 5 minutes or so, what can you do about it? Well, the only way Apple has figured out was to create their own platform called Open Radar. It’s basically a 1990s style website where developers can file bugs, and then be ignored. It is utterly useless, most reports are just closed with no explanation, and there is no follow up whatsoever. In the world of open source and GitHub, it really feels like Apple either missed the train, or just really does not care about iOS developers.

Got a great idea for an Xcode feature that would simplify your life? The only option you have is to file a radar and then pray.

Bottom line is, Xcode is not an editor anybody chooses to use, but if you’re developing native iOS apps, it’s kind of the only choice you’ve got.

React Native

In React Native, there is no shortage of options in terms of code editors. Since you are just writing JavaScript code, any code editor will do, really, such as Atom or Sublime Text. In my opinion though, the best editor for RN development is by far Microsoft’s Visual Studio Code, or VSCode for short. My favourite things about VSCode is that it’s basically the opposite of Xcode:

  1. It is extremely stable. I never once had an issue with VSCode crashing.

2. It’s open source. The entire codebase is on GitHub, and many of the project collaborators actually do not work for Microsoft. Since it’s in the open, anybody can file bugs, feature requests, and even open pull requests implementing them! And since the editor itself is written in JavaScript, any React Native developer should feel quite comfortable playing around with the codebase.

3. It’s very flexible. Got a feature idea that the VSCode team won’t merge? You can always create a plugin for it. Plugins don’t work for your use case? Fork the repo! Whatever you want to implement, you will almost certainly find a solution, even if the team behind the editor does not agree with you. The same cannot be said for Xcode and Apple.

Since I’ve started using VSCode, I’ve been so relieved from all the headaches that usually come with Xcode, and whenever I’ve had to touch Xcode again, it felt like burden.

Verdict:

It’s pretty clear that React Native takes this one. With Xcode being mostly the only option for native iOS development, and React Native having much more flexible and stable options on its side, it’s hard to argue differently. I will point out though that autocompletion on Xcode is much better than VSCode’s, mainly because native iOS uses statically typed languages like Swift and Objective-C, whereas JavaScript is dynamically typed, and much harder to infer. This problem does go away if you use Typescript to write your application, though (which I most definitely recommend!).

That’s it for the first round! Check out the second round here.

PS: Did anyone catch the terrible pun in the title?

Don’t hesitate to comment or share your experience in the comment section below.

If you want to know more about our digital agency, please visit our website or reach us here.

--

--

Kenza Iraki
Samsao
Writer for

Engineering Team Lead @ Breathe Life. Creator of Let’s React meetups https://twitter.com/kenza_iraki