Get in Touch (703) 956-1009

Opinion: Don’t bother with native code

Opinion: Don’t bother with native code

Opinion: Don’t bother with native code

There’s always been something of a philosophical discussion over the efficiency of developing native apps. The argument follows that native apps give you access to a platform’s full functionality helping you to manipulate built-in capabilities to create sophisticated applications. Conversely, there is a popular conception that web apps are a stop-gap, which may be easier to run in the browser, but lack the quality of native apps.

But, these perceptions aren’t necessarily fair and comparisons between HTML5 and native apps are not always fought on a level playing field. My argument is that with the right frameworks and JavaScript virtual machines, web apps can be just as powerful as native apps and more scalable. That’s why developers should avoid native code where possible – with one small caveat – native code is bad in the long run if you are not working on or building a platform.

In other words, if you work on the UIKit team at Apple, this article is not for you. If you work on the kernel for Windows, this article is also not for you.

Native Code

It’s all about quality vs. scale

To create a great application and ensure that it gets into the hands of as many users as possible, it needs to scale for as many platforms as possible. But, native code limits scalability. Two of the most popular mobile platforms for native apps are written in different languages: Java for Android and Objective-C for iOS. Even if you’re proficient in both languages this means having to re-write the code. It’s double the work. Technology silos just don’t work in the long run.

This is where web apps prove their worth. They can scale across any platform, and any device, but without being able to access certain native device functions like the camera or geo-location, web apps in the past have limited app capability. To overcome this issue, web developers often use hybrid applications (i.e. Cordova/Phonegap) so that they can still use their web knowledge and almost build a native mobile application. They key word there is "almost".

Hybrid applications are good enough for a lot of scenarios, but also inadequate for a sizable share of them. Hybrid application performance suffers as applications grow in size. We spent a lot of time trying to debunk the myths that HTML5 on mobile is too slow to be good. The honest truth is that “good enough” just doesn’t cut it for most.

JavaScript Native: the answer to an age old problem

But pause before you jump back into developing native apps. There is a solution here; it’s JavaScript. JavaScript is the only language that runs on every single platform, and the only true "write once run everywhere" language. Whether that's directly on a JavaScript engine, or as an abstraction to native languages, the important part is that the language that the actual business logic is coded in stays the same.

There are frameworks that use the JavaScript engine on the device to evaluate JavaScript and in turn execute native code. The most well-known of these are NativeScript and React Native. Note that neither of these frameworks actually run JavaScript on the device; both include an embedded JavaScript engine (V8 for Android and JavaScript Core for iOS). This means that strictly speaking, both of these frameworks could be extended to the desktop without a huge technical divide to cross.


Get in Touch

We want to hear from you. Complete the form and we will be in touch with you within 24 hours.