開源日報 每天推薦一個 GitHub 優質開源項目和一篇精選英文科技或編程文章原文,堅持閱讀《開源日報》,保持每日學習的好習慣。
今日推薦開源項目:《簡單漂亮 cssfx》
今日推薦英文原文:《How Popular is JavaScript in 2019?》

今日推薦開源項目:《簡單漂亮 cssfx》傳送門:GitHub鏈接
推薦理由:一組簡單漂亮的 CSS 樣式集合,不需要其他樣式庫的支持,你可以很簡單的在網頁上就預覽到它們的效果——和複製它們。實際上作為一個測試自己 CSS 實力的方式這樣很不錯,把自己能夠做出的好用的樣式一一擺出來,興許能夠看到新的樣式組合的可能性,之後要復用這些樣式也會很方便。
今日推薦英文原文:《How Popular is JavaScript in 2019?》作者:Eric Elliott
原文鏈接:https://medium.com/javascript-scene/how-popular-is-javascript-in-2019-823712f7c4b1
推薦理由:不得不承認,JS 的確很流行

How Popular is JavaScript in 2019?

When people ask me what language they should learn, I tell them to start with JavaScript. Why? JavaScript is the standard programming language of the web, and the software you write with JavaScript will be usable by everybody.
Software ate the world, the web ate software, and JavaScript ate the web.
This is enough for me. I want to write software that anyone can use, and virtually everyone who has an internet connected device with a screen can use apps written in JavaScript.

There are lots of ways to rank programming languages. A handful of indexes dominate Google for the search term 「programming languge index」. Pick your favorite. Those indexes rank JavaScript #7, #3, and #1, respectively.

No matter where it falls in your favorite ranking, JavaScript is a top contender in real-world usage. I frequently argue that it』s the most used programming language in the world. What I mean by that is that more programmers write JavaScript than any other programming language in the world. If you piled all the source code written in the last decade into piles, JavaScript would be the biggest pile.

This is reflected in the number of packages available in programming languages package repositories. JavaScript』s standard package manager has more packages than Java and PHP combined:

This trend is also reflected on GitHub:

GitHub Top Languages Over Time

But don』t these other languages have better standard libraries? Wouldn』t that cause a lot more packages to be needed for JavaScript? Sure. Absolutely. I』ll give you that. And that might account for a few thousand packages. But we』re not talking about a few thousand. There are over 800,000 packages on npm, most of them available for open source use in your applications. Clearly, there』s a lot more to this dominance than the quality of the standard library.

Let』s corroborate this with some more data. As I mentioned, JavaScript is the standard programming language of the web, and the web is the most used computing platform ever built.

There are over 1.6 billion web sites in the world, and JavaScript is used on 95% of them (1.52 billion web sites with JavaScript). By virtue of this fact, virtually every computing device in use today runs JavaScript, including iPhones, Android phones, Apple Mac OS, Microsoft Windows, Linux, smart TVs, etc.

There are about 800 million Windows 10 devices installed in the world, and roughly 800,000 apps in the Windows Store. That』s radically under-counting the number of apps that work on Windows, though. Windows app distribution was dominated by direct downloads a long time before the concept of official app stores became popular, and Windows 10 will happily run apps written for previous versions of windows. It』s possible Windows will run as many as 35 million apps — written in a variety of languages, dominated by C, C++, Visual Basic .NET, and C#.

Web vs Windows, iOS, Android by raw app numbers. The missing ones are too small to see relative to websites.

Java is another top contender for the most used programming language by virtue of the fact that it』s the native language for the most popular mobile computing platform in the world, Android. Want to write a native app for an Android phone? It will almost certainly be written in Java and be installed from the Android store.

There are 2.3 billion mobile devices running Android and apps written for Android. But there are only 2.1 million apps in the Android store.

Want to write a native app for iOS? There are about 1.8 million apps in the Apple store, most of which are written in Objective C or Swift. That』s two languages competing for dominance on the 2nd most popular mobile computing platform in the world.

Server-side languages are certainly popular, including Java, Python, PHP, Ruby, and Scala, but Node.js is also very popular on the server side, and it uses JavaScript.

There are roughly 7 billion IoT devices in the world. The top platforms are AWS IoT (C, JavaScript) and Google Cloud IoT (JavaScript, C, C++, Go). Common languages for device programming for IoT include C, C++, JavaScript, and Java. In spite of the sheer number of mass market manufactured IoT devices there are, there are orders of magnitude fewer software developers programming for IoT devices than there are programming for the web platform, and orders of magnitude less code being written for them.

All that said, for the first decade or so of the web, JavaScript was used for little more than mouse hover animations and little calculations to make static websites feel more interactive. Let』s assume 90% of all websites using JavaScript use it in a trivial way. That still leaves 150 million substantial JavaScript applications:

Web vs everything else, assuming 90% of web sites don』t qualify as 「apps」.

Even if we decimate the web numbers again, the web platform would still be bigger than Android and iOS combined:

Cut out 90% of websites with JS, then do it again for good measure, and it』s still bigger than Android + iOS combined.

But this is getting a little ridiculous now, because the most popular apps today are things like Facebook Messenger, WhatsApp, Snapchat, Instagram, Netflix, Hulu, Spotify, Uber, and games that compile for multiple platforms (e.g., Fortnite), rather than a lot of native Windows apps. Interesting trend: Most of these have web versions, and some can』t be found in the Microsoft Store.

My favorite apps for Android are Progressive Web Apps like Twitter (written in JavaScript), because they』re light and fast, and I don』t have to wait for them to install to start using them.

And this is my favorite thing about JavaScript, because that Twitter PWA works on my Android Phone, on my iPad, on my desktop browser, and I never have to install it anywhere. On my mobile devices, it looks and acts just like a native app, and even when I』m offline, I can browse tweets already downloaded and cached.

If you want your apps to be usable by the most people, JavaScript is a great choice.

Eric Elliott is a distributed systems expert and author of the books, 「Composing Software」 and 「Programming JavaScript Applications」. As co-founder of DevAnywhere.io, he teaches developers the skills they need to work remotely and embrace work/life balance. He builds and advises development teams for crypto projects, and has contributed to software experiences for Adobe Systems, Zumba Fitness, The Wall Street Journal, ESPN, BBC, and top recording artists including Usher, Frank Ocean, Metallica, and many more.
下載開源日報APP:https://openingsource.org/2579/
加入我們:https://openingsource.org/about/join/
關注我們:https://openingsource.org/about/love/