Should You Learn Swift or ReactNative?


  • Share on Pinterest

This discussion came up recently. I thought I would share my thoughts and suggestions with those in this situation—especially new programmers.

Before we proceed, let me clarify that I am not advocating either platform and have tried to give balanced and impartial advice.

If you are new to programming, I first recommend learning just one language at a time. I also recommend reading as much as possible on the general theories and approaches to programming. These will most likely be the same across languages. Plus, you will soon discover that programming is more about patterns, practices, and theories than the syntax of a language.

When it comes to Swift or ReactNative, I feel there are several questions you need to ask yourself.

  1. Am I targeting or wanting to work with a particular platform?
  2. Am I planning to write applications that may end up on multiple platforms?
  3. Am I planning or already have a job that will use a particular platform?
  4. Do I plan to also work with the Web?

These four questions will provide the necessary answers to guide your learning. If you want to work for a particular company that already has a direction or plans to create apps for a targeted audience, then I would say go with the plan in place.

Creating applications using a platform's native language is, I feel, always the best way, both for performance and compatibility. While so-called ‘hybrid' languages are constantly improving performance, I still think that working with hardware at a native level will yield the best results. There are always lots of arguments on both sides of this discussion. This is just my opinion. So, in this case, I would say for iOS Swift, and Objective-C are better than React Native.

A downside to Swift (at the time of this post) is development platforms. Currently, the only easy way to create Swift-based applications for iOS is on macOS machines. You can write the code on any platform, but submitting it to the AppStore and quickly testing it on devices still requires a Mac or Hackintosh if you are so inclined, but I do not recommend it.

The Swift language is cross-platform on macOS and Linux right now. There are some unofficial ports to Windows, but Apple does not support them. Also, the UI layer is not open-source, which is crucial for app building. ReactNative is genuinely cross-platform, allowing you to write and run code on the platform of your choice using Node and JavaScript.

The languages have excellent online support, from documentation and learning resources to active communities. You can probably solve any problem or question just by using the trusty programmer tool, Google.

If you are concerned about the maturity of each language, then here are some numbers worth considering.

Swift has been around since WWDC14. Since then, it has (as of this post) reached version three, with many breaking changes between versions. Version 4 will supposedly be less destructive to existing code, but you should be aware of the new language growing up, which means painful changes between versions.

ReactNative has been around internally at Facebook since 2013. The first public appearance was in March 2015. Like Swift, it is a new language with rapid adoption, although the code base appears to have fewer breaking changes than Swift with each release.

You might also be interested in the newer Kotlin Multiplatform technology, which is starting to get a lot of attention.

So, in the end, hopefully, I have given you some things to consider when choosing. Another option would be both, but one at a time!

There is no denying that a growing trend does seem to be developing in non-native platform languages.