# Comparison Between Mini-Programs and Traditional Development

Compared to traditional development, mini-programs can help developers achieve:

  • Faster loading
  • More powerful capabilities
  • Native experience
  • Easy-to-use and secure data openness
  • Efficient and simple development

# 1. Differences Between Mini-Program Development and Regular Web Development

The primary development language for mini-programs is JavaScript. Mini-program development shares significant similarities with regular web development. For front-end developers, the migration cost from web development to mini-program development is not high, but there are still some differences between the two.

In web development, the rendering thread and script thread are mutually exclusive, which is why long-running scripts may cause the page to become unresponsive. In contrast, in mini-programs, these two are separated and run in different threads. Web developers can use various DOM APIs exposed by browsers to select and manipulate the DOM.

As mentioned above, the logic layer and rendering layer of a mini-program are separated. The logic layer runs in JSCore, which does not have a complete browser object, thus lacking related DOM API and BOM API. This difference means that some libraries familiar to front-end developers, such as jQuery and Zepto, cannot run in mini-programs. Additionally, the JSCore environment is not identical to the NodeJS environment, so some NPM packages also cannot run in mini-programs.

Web developers face a variety of browser environments: on the PC side, they need to deal with IE, Chrome, etc., while on the mobile side, they encounter Safari, Chrome, and various WebView implementations in iOS and Android.

When developing web pages, web developers only need to use a browser along with some auxiliary tools or editors. However, mini-program development is different and requires processes such as applying for a mini-program account, installing mini-program developer tools, and configuring the project.

# 2. Comparison Between Mini-Programs, H5, and Native Applications

# 2.1 H5 Mobile Applications

What we commonly refer to as H5 can usually be considered a type of Web App. Compared to web pages opened in desktop browsers, H5 applications primarily add responsive design and interaction optimizations, making them more suitable for display and operation in mobile browsers. Since it's a web application, it is still implemented based on JavaScript, CSS, and HTML. Being built on various front-end technology stacks, the biggest advantage is speed, simplicity, convenience, and the availability of numerous technical resources.

However, the disadvantages of H5 coexist with its advantages. For example, since the technology is already very mature, newcomers with limited front-end experience may feel overwhelmed by the variety of frameworks, modules, task management tools, and UI Libraries. Additionally, compared to native applications, system permission access (such as data caching capabilities and network communication status) is relatively limited. When low-performance devices load pages with complex logic, noticeable lag and delays can occur.

# 2.2 Native Applications

Native applications, also known as Native Apps, differ from H5 applications implemented using the three main front-end components. Native applications are typically developed using proprietary languages for iOS and Android: Objective-C (or Swift) and Java (or Kotlin). Most widely-used national applications, such as WeChat and Alipay, fall into this category of native applications.

Being called "native applications," they are like the favored children of operating systems, naturally possessing excellent performance and user experience potential. They also boast rich component libraries and comprehensive interface support. However, the biggest drawback of native applications is the inability to develop cross-platform. In today's mainstream market, both iOS and Android platforms must be supported.

# 2.3 Hybrid Applications

Hybrid applications are generally referred to as Hybrid Apps. Simply put, hybrid applications encapsulate native functionalities into corresponding JS interfaces, using H5 for front-end development of the App (i.e., H5 as content + native application as a shell). Although it appears as a complete native mobile application, the actual pages are still web-based. A single codebase can generate installation packages for both iOS and Android, resulting in lower development costs.

Common applications like Taobao and JD.com frequently update and optimize their features to better align with the goal of "staying close to users." Some functions are implemented natively (Native), while others are realized through H5 pages. Such applications belong to what we call hybrid applications.

# 2.4 Mini-Programs

Strictly speaking, mini-programs do not fall into any of the above three types of applications. Mini-programs are mainly developed using common front-end technologies like JavaScript and CSS, but they do not fully implement HTML. On different operating systems,

the JavaScript code runs in JavaScriptCore on iOS and X5 JSCore on Android. Each mini-program platform has some self-developed core components, leading to variations in the rendering view layer components.

© FinClip with ❤ , Since 2017