JavaScript is not the most beautiful programming language in the world. That's why a world-class expert has written a book about the "essence" of the language. The name of this book is "Deep Digging into the Highlights of JavaScript" because the good stuff is buried quite deep. Even so, it is quickly becoming one of the most popular languages in the world. This popularity is well deserved, because despite the language's shortcomings, JavaScript provides developers with important advantages that other languages cannot. There are some advantages that come after browser developers agreed on Javascript (well, technically ECMAScript) as the standard for the web language. The rest is the inherent web application programming model and has not been improved through any enhancements. However, although native applications dominate web applications on mobile devices, JavaScript's dominance is gradually shifting to mobile devices. Will it eventually dominate?
Popular but Not Prioritized
The most recent TIOBE community list ranked JavaScript sixth among all programming languages and continues to rise. The TIOBE method's rankings tend to favor older, more mature languages and are less good at following trends. In contrast, the Redmonk ranking method places JavaScript in the first position. The Redmonk approach will be biased to some extent toward languages with strong open source communities, but at the same time will substantially reflect current trends and interests. Our own Developer Economy Overview has shown that the HTML5/Javascript combination is already the second most popular language used by mobile developers, used by almost 55%. Only by a small margin, 57% of people use Java. However, while we found that the combination of HTML5 and Javascript was the preferred choice among people (19%), it was far behind Java (29%) in this square. This looks set to improve significantly in the coming years. [How do you think of this? We've got a new survey, so check it out and let us know what you think]
JavaScript flies to freedom in browsers
This isn't a standard "web" win" argument. I don’t think browsers or webview-based applications will eventually dominate mobile devices. Even if it is used and grows, it will not be the norm. If web standards are really to be opened up to rule mobile devices in the future then they need to start with the Document Object Model (DOM). The DOM is not the foundation on which applications are built, but documents. Of course you could initially design an app for documents around a platform, but you'd be stuck. Take a look at the current frameworks that allow you to design fairly high-performance applications for mobile browsers or web views: React.js, Famo.us, and lonic. What these three have in common is to use DOM as little as possible.
Yes, there are too many WebGL (or HTML5 Canvas must-have), but these are low-level APIs. What you need is a large, possibly multi-byte, good framework to create an excellent platform for developing most applications. This doesn't fit well with the web application programming model, where the latest application code is hosted on a remote server, and especially not in a mobile environment. It's true that you can create a hybrid application on top of a big, nice WebGL store that's local, and just get application-specific code from a remote server. But why use a browser? Why not just javaScript outperforms other cross-platform frameworks in hardware graphics accelerators (hint: Qt offers a good one). A high-level API wouldn't have that much overhead in bridging between languages. There may also be a lack of restrictions when it comes to accessing certain features.
There are now several very interesting new options that fit this description. React Native and NativeScript. They work in different ways, but both use JavaScript to build an application with a native UI. Appcelerator's TiNext might also be interesting, even if they've been talked about a lot over the years without ever releasing a version, so let's wait and get a glimpse of it.
JavaScript Exception
Apple has restored JavaScript’s dominance on mobile. One of the key things that prevents most developers from adopting an agile, web-style continuous delivery model on mobile is Apple's ban on code downloads. Without this significant slowdown in iteration mode, comparative testing would be much more difficult. This actually means that developers, especially beginners, will learn slower. Until recently, the only way to get faster iterations was to start with Android first and develop a hybrid app because Apple made JavaScript an exception in the webview code download rules. In the first case, it means that most early adopters are moving away from the platform. Unfortunately, the UX trade-off in the second case is too great, and most developers take that route due to user application failures or switching to local. However, in ios7, the JavaScriptCore interface was added for running JavaScript, and in the latest ios developer program license terms, they modified the rules for code download exceptions to include JavaScriptCore.
This makes sense from a security perspective. Apple can audit and update their runtimes, however if they allow third-party runtimes to download code, they are not effectively monitoring security issues. Because JavaScript is Apple's only scripting option and they don't allow code to be downloaded locally, JavaScript is regaining its privileged position as the only option for those who want to iterate quickly. The availability of JavaScript has sparked efforts like React and NativeScript and Apple's relaxed grip on code download policies has been perfectly publicized.
Will openness win?
Web advocates sometimes suggest that open standards based on the web will ultimately win, because openness always wins. However, Linux is a clear example of an open and rapidly evolving ecosystem without committee-aligned standards. React, Facebook seems to have become a rapidly building developer ecosystem in open source projects. There's already a rapidly growing committee around React.js, which clearly gives them a head start. But the NativeScript team at Telerik is working with Google, so Angualr 2.0 needs to be seamlessly integrated. Google intends to support non-DOM environments regardless of whether web standards move towards it. It may take Microsoft and Google a long time to support the standards they will implement in future browsers. But they are working together towards TypeScript, making it easier to build a less complex application with JavaScript (proven that the compiler is smarter than humans at spotting type mismatches).
Apple has built a lot of pretty impressive tools for their new Swift language, especially interactive playgrounds. However, Facebook may have had a better coding experience on React Native based on immediate feedback and high-frequency on-the-fly coding. Apple will continue to iterate their tools, and the developer community has now added these new JavaScript environment tools. Android may be technically open source, but it's not open in terms of community building. Google is on its own to enhance Android's platform and tools. Perhaps it is the open developer community that will win, and open source that is truly community-based can iterate faster than open source based on open source standards. To this end, a "native UX using JavaScript to build" environment and success, such a platform will certainly not fail. Applications will still be built based on the look and feel of the platform and using new platform-specific APIs.
At this point, it looks like the very open JavaScript developer community is going to win, because they create apps that have the look, feel, and performance of the native platform, in addition to requiring web development experience. Closed platforms have always won in the past because apps at that time needed to be customized for their closed ecosystems. Currently, open web standards are still losing. If mobile browser manufacturers can agree to new standards and allow the applications they create to have the experience of native applications, thenthey will definitely win.
What did you use to make it?
Do you think JavaScript will control the future of mobile development? Or will Java, Objective-C and Swift continue their leadership position? As for the Internet of Things, will its backend pass Node.js? Take the survey and let us know what you use to build your app.
The above is the detailed content of Detailed explanation of why JavaScript wins on mobile devices?. For more information, please follow other related articles on the PHP Chinese website!

Understanding how JavaScript engine works internally is important to developers because it helps write more efficient code and understand performance bottlenecks and optimization strategies. 1) The engine's workflow includes three stages: parsing, compiling and execution; 2) During the execution process, the engine will perform dynamic optimization, such as inline cache and hidden classes; 3) Best practices include avoiding global variables, optimizing loops, using const and lets, and avoiding excessive use of closures.

Python is more suitable for beginners, with a smooth learning curve and concise syntax; JavaScript is suitable for front-end development, with a steep learning curve and flexible syntax. 1. Python syntax is intuitive and suitable for data science and back-end development. 2. JavaScript is flexible and widely used in front-end and server-side programming.

Python and JavaScript have their own advantages and disadvantages in terms of community, libraries and resources. 1) The Python community is friendly and suitable for beginners, but the front-end development resources are not as rich as JavaScript. 2) Python is powerful in data science and machine learning libraries, while JavaScript is better in front-end development libraries and frameworks. 3) Both have rich learning resources, but Python is suitable for starting with official documents, while JavaScript is better with MDNWebDocs. The choice should be based on project needs and personal interests.

The shift from C/C to JavaScript requires adapting to dynamic typing, garbage collection and asynchronous programming. 1) C/C is a statically typed language that requires manual memory management, while JavaScript is dynamically typed and garbage collection is automatically processed. 2) C/C needs to be compiled into machine code, while JavaScript is an interpreted language. 3) JavaScript introduces concepts such as closures, prototype chains and Promise, which enhances flexibility and asynchronous programming capabilities.

Different JavaScript engines have different effects when parsing and executing JavaScript code, because the implementation principles and optimization strategies of each engine differ. 1. Lexical analysis: convert source code into lexical unit. 2. Grammar analysis: Generate an abstract syntax tree. 3. Optimization and compilation: Generate machine code through the JIT compiler. 4. Execute: Run the machine code. V8 engine optimizes through instant compilation and hidden class, SpiderMonkey uses a type inference system, resulting in different performance performance on the same code.

JavaScript's applications in the real world include server-side programming, mobile application development and Internet of Things control: 1. Server-side programming is realized through Node.js, suitable for high concurrent request processing. 2. Mobile application development is carried out through ReactNative and supports cross-platform deployment. 3. Used for IoT device control through Johnny-Five library, suitable for hardware interaction.

I built a functional multi-tenant SaaS application (an EdTech app) with your everyday tech tool and you can do the same. First, what’s a multi-tenant SaaS application? Multi-tenant SaaS applications let you serve multiple customers from a sing

This article demonstrates frontend integration with a backend secured by Permit, building a functional EdTech SaaS application using Next.js. The frontend fetches user permissions to control UI visibility and ensures API requests adhere to role-base


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SublimeText3 English version
Recommended: Win version, supports code prompts!

WebStorm Mac version
Useful JavaScript development tools

SublimeText3 Linux new version
SublimeText3 Linux latest version