Comparison between Web and Native mobile development

·

9 min read

Prologue

It can often be found that react native platform was chosen as building commercial apps or prototypes. React Native is a cross-platform that can develop both Android and iPhone apps simultaneously using JavaScript. Another mobile cross-platform using JavaScript is Cordova. I think the background to use JavaScript as cross mobile platforms is an advancement in web development. In this blog, I would like to look at the pros and cons of web development and native development.

image.png

Web Development

To discuss web development, I would like to define web development as web frontend development by using HTML5, CSS3, and JavaScript that runs on the browser.

  • HTML5: the structure of the web pages
  • CSS3: the styling such as color and size
  • JavaScript: login and processing, fetch of data

CSS3 and HTML5 can be dynamically controlled by using JavaScript.

image.png

The three advantages of web development

  • The advantage of web development is that it is easier than native development. Native languages such as Kotlin and Swift are type languages. In order to declare and use classes, functions, and variables, it is necessary to express the type explicitly. Type inference is possible only when a type declaration is made somewhere. Meanwhile, JavaScript does not declare a type, and the conversion between types is free. So, the barriers to development are lower for developers who started the development. This characteristic also plays as a disadvantage, which will be discussed in the section of cons of web development.

  • The second advantage of web development is the universal availability of the Internet and browser. Unlike in the past, there are efforts to set standards for web development, so web developments can run on any modern browser. For example, mobile also has modern browsers. The Raspberry Pi also has a modern browser. Therefore, if developers implement their ideas through web development, they can express their ideas anywhere in the world where there are internet and browser.

  • The third advantage of web development is the potential of the ecosystem of JavaScript. As discussed earlier, the two mobile cross platforms adopt JavaScript. Node.js allows JavaScript to run directly outside the browser. For example, a web server can be built by using JavaScript without learning any additional programming languages. Electron helps to build desktop applications by using JavaScript. Therefore, if developers learn web development, they also get the alternative way how to create mobile and desktop applications.

image.png

The three disadvantages of web development

  • The disadvantage of web development is that JavaScript is not the type language, so it is difficult for developers to guess the specification of classes, functions, and variables only by seeing declarations of classes, functions, and variables. For example, in order to know what functions will return, it is necessary to check the body of functions.

  • Errors can be checked only on the runtime because JavaScript is not the type language and not a compiled language. If the size of the web development is big, it can be an issue. Because of that, ESLint can be used, or some web developers have adapted TypeScript.

  • Another disadvantage of web development is that machines cannot be used fully. Because it runs in the browser, functions that the browser does not provide cannot be used in web development. For example, on the iPhone, the PWA function can only be supported by the Safari browser. However, Safari does not support the iPhone's Push notification, accessing the file system, and Bluetooth.

Native development

The three advantages of the native development

  • The advantage of native languages is that they are type and compile languages. Errors can be detected in the compile-time in advance before run-time. This provides developers an opportunity to reduce runtime errors in the mobile environment that emphasizes user experience.

  • Another advantage of native development is that it is specialized for each platform so that the performance of mobile applications can be improved. Moreover, in order to develop specialized functions such as machine learning and AR in Android and iPhone, native languages should be needed.

  • The third advantage of native development is that developers can experience experimental or the latest features of each mobile platform from conferences. They also can understand the context of why these features are needed based on their own experiences of native developments. The context/background of features can lead developers to understand and apply features deeply in order to solve various problems. Meanwhile, in cross platforms, the context/background of features is hidden, and it can cause the limitation of usage and understanding of features.

image.png

The three disadvantages of the native development

  • Being specific to each native platform can be a drawback because the learning curve is higher than that of web development. I think this is one of the reasons why there are many basic courses on native development in online courses, but there are few intermediate or advanced courses. Developers who want to learn native development need a plan with enough time rather than a plan to produce results in a short period of time.

  • The disadvantage of native development is that if developers need to develop both native platforms, they should know both platforms well. It is related to understanding the characteristics of both platforms rather than the grammatical differences of the native languages of the two platforms. Developers have to distribute their energy to understanding the characteristics of both platforms and developing logic. In the case of the cross-platform, developers can focus on one platform, the cross-platform, not both platforms.

  • Another drawback of native development is that the app must pass the app review such as google play and the app store when updating an app in an urgent situation. Let’s imagine the following situation. After the initial app release, there is a high possibility that there will be an urgent need to update because of bugs found. If bugs are related to the logic of controlling data, not UIs, updating quickly can improve the maintenance productivity of developers. In the case of React Native, the app can be updated without app review by using CodePush. However, applications developed through native development should wait for the review of google play and the app store.

image.png

Epilogue

I think that it is not valid that which technology is superior between web development and native development. The purpose of understanding the pros and cons of web development and native development is to select the optimal development stack considering the current project, development cost, and resources. I would be happy if this blog could be of some help to those who are deciding the development stack of the mobile.