前7名現在該學習的現代程式語言

14 minute read

Rust,Go,Kotlin,TypeScript,Swift,Dart 和 Julia 如何強化 (boost) 你的職業發展並提高軟體開發技能

original post

Md Kamaruzzaman
software architect | technologist | writer | learner | reader
Dec 24, 2019

image Photo by h heyerlein on Unsplash

Listening to audio file

如果我們將現代人類文明視為汽車,那麼軟體開發行業就像汽車的引擎,而程式語言就像引擎的燃料。您應該學習哪種程式語言? 學習一種新的程式語言是對時間,精力和智力的巨大投資。但是學習一種新的程式語言可以提高您的軟體開發技能,並可以強化 (boost) 您的職業發展,正如我在另一篇 Blog 文章中所寫的那樣:

https://medium.com/@md.kamaruzzaman/5-reasons-to-learn-a-new-programming-language-in-2020-bfc9a4b9a763

通常,應該選擇一種可以強化 (boost) 您的職業發展的程式語言。另外,應該學習一種流行度不斷提高的語言。這意味著您應該學習已建立且非常流行的程式語言。 我對主流程式語言非常敬重。但是在這裡,我將為您提供現代程式語言的列表,這些語言可以提高您的生產率,促進您的職業發展並讓您成為更好的開發人員。此外,我將涵蓋廣泛的領域:系統編程,應用程式開發,Web開發,科學計算。

image

術語 “現代程式語言” 是模棱兩可的。許多人將 Python,JavaScript 等語言視為現代程式語言。同時,他們認為 Java 是一種古老的程式語言。實際上,它們都是在同一時間出現:1995年。

大多數主流程式語言是在上個世紀開發的,主要是在1970年代 (例如C) ,1980年代 (例如C ++) ,1990年代 (例如 Java,Python,JavaScript) 。這些語言的設計目的不是利用現代軟體開發生態系統:多核 CPU,GPU,快速聯網,移動設備,容器和雲。儘管它們中的許多功能都具有諸如語言的並發等改型功能並可以自行調整,但它們還具有向後相容性,並且不會丟棄舊的,過時的功能。

通過在 Python 2 和 Python 3 之間進行明確的區分,Python 發揮了出色的作用 (或取決於上下文) 。這些語言通常提供10種方法來完成相同的任務,並且不關心開發人員的人機工程學。根據 StackOverflow 開發人員調查,大多數主流的舊程式語言在 “最可怕的語言” 類別中排名第一:

image
Source: Stackoverflow

我想在新舊程式語言之間劃清界限是在 2007年6月29日,即第一部 iPhone 發行時。此後,景觀發生了變化。在此列表中,我將考慮 2007 年後的程式語言。

image

首先,開發現代程式語言以充分利用現代計算機硬體 (多核CPU,GPU,TPU) ,移動設備,大量數據,快速聯網,容器和雲的優勢。而且,大多數現代程式語言都提供了更高的開發人員人體工程學,如下所示:

  • 簡潔明瞭的代碼 (less boilerplate coding)
  • Built-in support for concurrency
  • Null pointer safety
  • Type Inference
  • 更簡單的功能集
  • 降低認知負擔
  • 融合所有編程範例的最佳功能

其次,列表中的許多程式語言都具有破壞性,並將永遠改變軟體行業。其中一些已經是主流程式語言,而另一些則有望取得突破。最好至少將這些語言作為第二種程式語言來學習。 在上一篇博客文章:”關於2020年軟體開發趨勢的20條預測” 中,我預測了 2020 年許多現代語言的突破:

https://towardsdatascience.com/20-predictions-about-software-development-trends-in-2020-afb8b110d9a0


Dart

image

Dart 是這個列表中第二個 Google 推出的程式語言。谷歌是 Web 和 Android 領域的主要參與者,所以毫不奇怪谷歌投入在 Web 和 App Development 領域推出了自己的程式語言。在著名的丹麥軟體工程師 Lars Bak (領導 Chrome 的V8 JavaScript 引擎開發) 的帶領下,Google 在2013年發布了 Dart。

Dart 是一種通用程式語言,支持 “強型別” 和 “物件導向” 編程。Dart 也可以轉編譯為 JavaScript,並且可以在 JavaScript 幾乎可以在任何地方 (例如Web,Mobile,Server) 運行的地方運行。

主要特點:

  • 與其他 Google 語言 Go 一樣,Dart 也非常關注開發人員的工作效率。Dart 具有 clean,simple,簡潔的語法 (terse syntax),因此具有很高的生產力,並受到開發人員的喜愛。

  • Dart 還提供 “強型別” 和 “物件導向” 編程。Dart 也是此列表中第二個符合 “Scalable JavaScript” 標記的語言。

  • Dart 是支持 JIT 編譯 (運行時編譯) 和 AOT 編譯 (創建時編譯) 的少數語言之一。因此,Dart 可以針對 JavaScript 運行時 (V8引擎) ,並且 Dart 可以編譯為快速的本機代碼 (AOT編譯)

  • 跨平臺 Native App 開發平臺 - Flutter - 使用 Dart 作為開發 iOS 和 Android App 的程式語言。從那時起,Dart 變得越來越流行。

  • 與其他 Google 程式語言 Go 一樣,Dart 也具有出色的工具支持和龐大的 Flutter 生態系統。Flutter 越來越受歡迎,只會增加Dart的採用率。

人氣:

根據 Github Octoverse 的說法,Dart 是2019年增長最快的程式語言,去年它的流行度增長了五倍:

image

根據 TIOBE 指數,Dart 排名第23位,僅在短短4年內就已經超越了許多其他現有和現代程式語言:

image
Source: TIOBE index

它也是 StackOverflow 開發人員調查中排名第12的最受歡迎的程式語言之一:

image

Source: StackOverflow

與 Flutter 一樣,Dart 在過去兩年中也受到了廣泛的關注,Google Trends 明確表明:

image
Source: Google Trends

主要使用情境:

  • 應用開發
  • UI開發

主要競爭對手的語言:

  • JavaScript
  • TypeScript

Rust

https://miro.medium.com/max/1203/1*fr1Gjc_bt6gB06fUlfQNPQ.jpeg Source: Thoughtram https://thoughtram.io/rust-and-nickel/#/11

The System programming language landscape is dominated by near-Metal languages like C, C++. Although they give full control over programs and hardware, they lack memory safety. Even if they support concurrency, it is challenging to write Concurrent programs using C/C++ as there is no Concurrency safety. The other popular programming languages are interpreted languages like Java, Python, Haskell. They offer safety but need a bulky runtime or Virtual Machine. Because of their large runtime, languages like Java are not suitable for System programming. There were many attempts to combine the power of C/C++ and the safety of Haskell, Java. It looks like Rust is the first production-grade programming language that did the trick. Graydon Hoare first developed Rust as a side project. He was inspired by the research programming language Cyclone. Rust is open source and Mozilla is leading the language development along with many other companies and communities. Rust is first released in 2015 and has soon caught the eye of the community. In a previous post, I have taken a deeper look into Rust and argued why it is a better choice to use Rust over C++, Java in Big Data domain:

https://towardsdatascience.com/back-to-the-metal-top-3-programming-language-to-develop-big-data-frameworks-in-2019-69a44a36a842

主要特徵: Offers Memory Safety and Concurrency safety with the concept of Ownership and Borrowing. Compile-time guarantee of memory safety and concurrency safety i.e. if a program code compiles, then it is both memory safe and data-race free. This is the most appealing feature of Rust. It also offers the expressiveness of ML, Haskell. With Immutable Data Structures and functional programming features, Rust offers functional Concurrency and Data Concurrency. Rust is Blazingly fast. Idiomatic Rust gives better performance than Idiomatic C++ as per Benchmark Game. With no Runtime, Rust offers full control of modern Hardware (TPU, GPU, Multi-Core CPU). Rust has LLVM support. As a result, Rust offers first-class interoperability with WebAssembly and allows the Blazingly fast Web Code. 人氣: Since its debut in 2015, Rust is well accepted by the Developers and voted as the Most beloved language for four consecutive years (2016, 2017, 2018, 2019) in StackOverflow developers survey:

https://miro.medium.com/max/859/1*JQSUr9o0igYb22h_RnYTlA.jpeg Source: Stackoverflow https://insights.stackoverflow.com/survey/2019#most-loved-dreaded-and-wanted

According to GitHub Octoverse, Rust is the second-fastest-growing language just behind Dart:

https://miro.medium.com/max/722/1*gwjGGcibFfZhUZSJKqpT-A.jpeg

Source: Octoverse https://octoverse.github.com/

Also, programming language Popularity website PyPl has ranked Rust in 18th position with an upward trend: https://miro.medium.com/max/605/1*evWgcSuw1qfOb9wpr3ckqQ.jpeg Source: PyPl http://pypl.github.io/PYPL.html

Comparing the feature set it offers, it is no wonder that giant Tech companies like Microsoft, Amazon, Google finally announced their investment on Rust as a long term System programming language. In the last 5 years, Rust has been getting increasing traction every year, as shown by Google trends:

https://miro.medium.com/max/1151/1*0gKyrINweN2dGDD_gj8EVw.jpeg Source: Google Trends

主要使用情境:

  • System Programming
  • Serverless Computing
  • Business Applications

主要競爭對手的語言:

  • C
  • C++
  • Go
  • Swift

Go https://miro.medium.com/max/3861/1*7kbd-tVk3co-9RiilFN1TA.png Source: Wikimedia

Google is one of the biggest Web Scale companies. At the beginning of this century, Google has faced two scaling problems: Development Scaling and Application Scaling. Development scaling means that they could not add more features by throwing more developers. Application scaling means that they could not easily develop an application that can scale to the “Google” scale machine cluster. Around 2007, Google started to create a new “pragmatic” programming language that can solve these two scaling problems. In Rob Pike (UTF-8) and Ken Thompson (UNIX OS), they had two most talented Software Engineer in the world to create a new language. In 2012, Google has released the first official version of the Go programming language. Go is a system programming language but different from Rust. It also has a Runtime and Garbage collector (a few Megabytes). But unlike Java or Python, this runtime is packed with the generated code. In the end, Go generates a single native binary code that can run in a machine without additional dependency or Runtime. 主要特徵: Go has first-class support of Concurrency. It does not offer the ‘Shared Memory’ concurrency via Thread and Lock as it is much more difficult to program. Instead, it offers a CSP based message-passing concurrency (based on Tony Hoare paper). Go uses “Goroutine” (lightweight Green thread) and “Channel” for message passing. The most killer feature of Go is its simplicity. It is the most simple system programming language. A new Software Developer can write productive code in a matter of days like Python. Some of the biggest Cloud Native projects (Kubernetes, Docker) is written in Go. Go also has embedded Garbage Collector which means developers do not need to worry about Memory management like C/C++. Google has invested heavily in Go. As a result, Go has massive Tooling support. For new Go developers, there is a large ecosystem of tools. Usually, developers spent 20% of their time writing new code and 80% time they maintain existing code. Because of its simplicity, Go excels in the language maintenance field. Nowadays, Go used heavily in Business Applications. 人氣: Since Go first appears, the Software Development community has accepted it with arms. In 2009 (right after its debut) and 2018, Go has entered the Programming Language Hall of Fame list by the TIOBE index. It is no wonder that the success of Go has paved the way for a new generation of programming languages like Rust. Go is already a mainstream programming language. Recently, Go team has announced the work on “Go 2” to only make the language more solid: In almost all popular programming languages comparing websites, Go ranks high and has surpassed many existing languages. Here is the TIOBE index rating from December 2019 where Go ranks 15th:

https://miro.medium.com/max/1164/14otADyzXwAXDqCjbiJnszw.jpeg Source: TIOBE According to the Stackoverflow survey, Go is one of the top 10 most loved programming languages: https://miro.medium.com/max/859/1AlZjgpQhANe7uJ_pJMQmdQ.jpeg

Source: Stackoverflow https://insights.stackoverflow.com/survey/2019#most-loved-dreaded-and-wanted

Go is also one of the top 10 fastest growing languages according to GitHub Octoverse:

https://miro.medium.com/max/751/1*avYTdU-SuMxL3qMufe9Xag.jpeg Source: Octoverse https://octoverse.github.com/

Google trends also show increasing traction for Go over the last five years: https://miro.medium.com/max/1156/1*Dm_Tfz6rQKYHP14woSpd7A.jpeg

Source: Google Trends

主要使用情境:

  • System Programming
  • Serverless Computing
  • Business Applications
  • Cloud-Native Development

主要競爭對手的語言:

  • C
  • C++
  • Rust
  • Python
  • Java

Kotlin

https://miro.medium.com/max/1200/1*6MRnGxzKEA7tPJz-0fKLBQ.png

Java is the undisputed king of Enterprise Software Development. In recent times, Java has become the target of much criticism: It is verbose, needs lots of boilerplate coding, prone to accidental complexity. However, there is little argument about the Java Virtual Machine (JVM). JVM is a masterpiece of Software Engineering and offers a battle-hardened runtime that has passed the test of time. In a previous post, I have discussed in detail the advantages of JVM:

https://towardsdatascience.com/programming-language-that-rules-the-data-intensive-big-data-fast-data-frameworks-6cd7d5f754b0

Over the years, JVM languages like Scala tried to answer the shortcomings of Java and wanted to be better Java but failed. Finally, in Kotlin, it looks like a search for better Java is over. Jet Brains (the company behind the popular IDE IntelliJ) has developed Kotlin, which runs on JVM and answers the shortcomings of Java and offered many modern features. The best part is that unlike Scala, Kotlin is much simpler than Java and offers Go or Python-like developer productivity in JVM. Google has declared Kotlin as a first-class language to develop Android and boosted Kotlin’s acceptance in the community. Also popular Java Enterprise framework Spring has started to support Kotlin in the Spring eco-system since 2017. I have used Kotlin with Reactive Spring and the experience was amazing. 主要特點: The USP of Kotlin is its language design. I always view Kotlin as Go/Python on JVM because of its clean, concise code. As a result, Kotlin is highly productive. Like many other modern languages, Kotlin offers features like Null pointer safety, Type Inference. As Kotlin also runs in JVM, you can use the existing huge eco-system of Java libraries. Kotlin is a first-class language to develop Android App and has already surpassed Java as the number one programming language to develop Android App. Kotlin is backed by JetBrains and Open Source. So, Kotlin has excellent tooling support. There are two interesting projects: Kotlin Native (to compile Kotlin into native code) and kotlin.js (Kotlin to JavaScript). If they become successful, then Kotlin can be used outside JVM. Kotlin also offers a simple way to write DSL (Domain Specific Language) 人氣: Since its first release in 2015, the popularity of Kotlin is soaring. As per Stack Overflow, Kotlin is the fourth most loved Programming language in 2019: https://miro.medium.com/max/859/1*PmUb6Ozt9Cngh0IA9DCpAg.jpeg Source: Stackoverflow https://insights.stackoverflow.com/survey/2019#most-loved-dreaded-and-wanted

Kotlin is also one of the fastest-growing programming languages and ranked 4th:

https://miro.medium.com/max/749/1*P03_CPbYksuJzpdFxGiulA.jpeg Source: Github Octoverse

Popular programming language ranking website PyPl has ranked Kotlin as the 12th most popular programming language with a high upward trend: https://miro.medium.com/max/612/1*YKOiuBgCDHSKU4TQBbYbXw.jpeg Source: Pypl http://pypl.github.io/PYPL.html Since Google has declared Kotlin as the first-class language to develop Android Apps, Kotlin has experienced a huge positive boost in trending as shown below:

https://miro.medium.com/max/1154/1*ZqVPhJii9fxTTZZ_Pj3HZA.jpeg

Source: Google Trends

主要使用情境:

  • Enterprise Application
  • Android App Development

主要競爭對手的語言:

  • Java
  • Scala
  • Python
  • Go

TypeScript

https://miro.medium.com/max/816/1*TpbxEQy4ckB-g31PwUQPlg.png

JavaScript is an excellent language but pre-2015 JavaScript had many shortcomings. Even noted Software Engineer Douglas Crockford has written a book “JavaScript: The Good Parts” and implied that JavaScript has bad parts and ugly parts. With no modularization and with “Callback Hell”, developers did not like to maintain especially large JavaScript projects. Google even developed a platform to transcompile Java code to JavaScript code (GWT). Many companies or people tried to develop better JavaScript e.g. CoffeeScript, Flow, ClojureScript. But TypeScript from Microsoft arguably hit the Jackpot. A group of engineers in Microsoft, led by famous Anders Hejlsberg (creator of Delphi, Turbo Pascal, C#), created TypeScript as a Statically Typed, Modular superset of JavaScript. TypeScript is transcompiled to JavaScript during compilation. First released in 2014, it quickly attracted the attention of the community. Google was also planning to develop a Statically Typed superset of JavaScript back then. Google was so impressed by TypeScript that instead of developing a new language, they co-operated with Microsoft to improve TypeScript. Google has used TypeScript as the main programming language for its SPA framework Angular2+. Also, the popular SPA framework React offers support for TypeScript. The other popular JavaScript framework Vue.js has declared that they will use TypeScript to develop the new Vue.js 3:

https://miro.medium.com/max/1139/1*8Kaj35gc8dr3FmdlnmN6_A.jpeg Source: Vue.js Roadmap https://github.com/vuejs/roadmap

Also, node.js creator Ryan Dahl has decided to use TypeScript to develop a secure Node.js alternative, Deno.

主要特徵: Like Go or Kotlin in the list, the principal feature of TypeScript is the language design. With its crisp and clean code, it is one of the most elegant programming languages out there. In terms of Developer productivity, it is on par with Kotlin on JVM or Go/Python. TypeScript is the most productive JavaScript superset hands down. TypeScript is a strongly typed superset of JavaScript. It is especially suited for large Projects and rightly termed as “JavaScript that Scales”. The “Big Three” Single Page Application framework (Angular, React, Vue.js) offers excellent support for TypeScript. In Angular, TypeScript is the preferred programming language. In React and Vue.js, TypeScript is getting increasingly popular. Two of the biggest Tech Giants: Microsoft and Google are working together to develop TypeScript supported by a vibrant open source community. As a result, the tooling support for TypeScript is one of the best. As TypeScript is a superset of JavaScript, it can runs where JavaScript runs: everywhere. TypeScript can run on Browser, Server, Mobile Devices, IoT devices, and Cloud. 人氣: Developers love TypeScript for its elegant language design. In the Stackoverflow Developer survey, it has ranked joint second with Python in the most beloved language category:

https://miro.medium.com/max/859/1*t6wkuoA1IdPg9ncsg4bLBQ.jpeg

Source: Stackoverflow https://insights.stackoverflow.com/survey/2019#most-loved-dreaded-and-wanted

TypeScript is one of the fastest-growing Web programming languages and ranked fifth according to GitHub Octoverse: https://miro.medium.com/max/755/1*JTRjZ8ZBee5T-cfcH64Jtg.jpeg Source: Octoverse https://octoverse.github.com/

TypeScript also entered the Top 10 List (ranked 7th) according to the GitHub Contributions:

https://miro.medium.com/max/1023/1*Ad7zxTCZGSzt4ioC0ylf5A.jpeg

Source: Octoverse https://octoverse.github.com/ TypeScript is having more and more eyeballs in each passing year, which is reflected by Google Trends:

https://miro.medium.com/max/1154/1*STnhuXU-ZRMw2Bc3O6pV7w.jpeg

主要使用情境:

  • Web UI Development
  • Server-side development

主要競爭對手的語言:

  • JavaScript
  • Dart

Swift

https://miro.medium.com/max/1200/1*OVgSA8lppCUu7idWMgMMyw.png

Steve Jobs has refused to support Java (and JVM) in iOS as he has famously quoted that Java is no more a major programming language. We now know that Steve Jobs was wrong with his assessment with Java, but iOS is still not supporting Java. Instead, Apple has chosen Objective-C as the first-class programming language in iOS. Objective-C is a hard language to master. Also, it does not support the high developer productivity required by modern programming languages. In Apple, Chris Lattner and others have developed Swift as a multi-paradigm, general-purpose, compiled programming language that gives an alternative to Objective-C. The first stable version of Swift was released in 2014. Swift also supports LLVM compiler Toolchain (also developed by Chris Lattner). Swift has excellent interoperability with Objective-C codebase and has already established itself as the main programming language in iOS App development. 主要特點: One of the killer features of Swift is its language design. With simpler, concise and clean syntax, it offers a more productive alternative to Objective-C. Swift also offers features of modern program languages: null safety. Also, it offers syntactic sugar to avoid the “Pyramid of Doom”. As a compiled language, Swift is as fast as C++. Swift has support for LLVM Compiler Toolchain. So, we can use Swift in server-side programming or even Browser programming (using WebAssembly). Swift offers Automatic Reference Counting (ARC) support and thus limits memory mismanagement. 人氣: Developers love Swift programming language like many other modern languages. According to the StackOverflow survey, Swift ranked 6th as the most beloved programming language: https://miro.medium.com/max/859/1*BxHjlXZ_UfQSNbnVY0F7nQ.jpeg

In the programming language ranking of TIOBE, Swift has moved to the number 10 ranking in 2019. Considering how young the language is (5 years), this is quite a feat:

https://miro.medium.com/max/1166/1*wO5MgevW6NqQ0ujfNqMBZw.jpeg

Source: TIOBE Index Google trends also show a sharp rise in the Popularity of Swift followed by a slight decrease in trending in the last couple of saturation:

https://miro.medium.com/max/1149/1*EO-TFNeitbEz_T4I3pRoIw.jpeg

Source: Google Trends

主要使用情境:

  • iOS App Development
  • System Programming
  • Client-side development (via WebAssembly)

主要競爭對手的語言:

  • Objective-C
  • Rust
  • Go

Julia https://miro.medium.com/max/1200/1*claL_4fuNqq9ZO8F5RkYqA.png

Most of the programming languages in this list are developed by large corporations except Julia. In technical computing, usually dynamic languages like Python, Matlab are used. These languages offer easy-to-use syntax but are not fit for large-scale Technical computation. They use C/C++ libraries for the CPU intensive tasks which gives the famous Two-Language problem as they need Glue Code to bind both languages. As Code is translated between two languages, there is always some performance loss. To tackle the issue, a group of researchers at MIT planned to create a new language from the ground-up which takes the advantages of modern hardware and combines the best parts of other languages. They work in the MIT innovation lab with the following Manifesto: https://miro.medium.com/max/1378/1*sqvWUec74Co1DpySnbQihg.jpeg Source: Julia Presentation https://genome.sph.umich.edu/w/images/3/3e/Julia_presentation.pdf

Julia is a dynamic, high-level programming language that offers first-class support for Concurrent, Parallel and Distributed Computing. The first stable version of Julia is released in 2018 and soon got the attraction of the community and industry. Julia can be used in Scientific Computing, Artificial Intelligence, and many other fields and can finally solve the “Two-Language” problem. 特徵: Like Rust, the key feature of Julia is the design of the languages. It tries to combine some of the best features of the existing programming language in high performance and Scientific computing without sacrificing performance. Until now it has done a great job. Julia is a dynamic programming language with optionally typed. Thus, Julia is easy to learn a programming language and highly productive. It uses multiple-dispatch programming paradigm at its core. It has built-in support for Concurrent, Parallel and Distributed Computing. It also offers asynchronous I/O for I/O intensive tasks. It is Blazingly fast and can be used in Scientific Computing where millions of threads are required. 人氣: Julia mainly competes with Python in many areas. As Python is one of the most popular programming languages, it will take a few years until Julia will be mainstream. Julia is relatively new (only one-year-old) but still ranks 43rd in the TIOBE index: https://miro.medium.com/max/1178/1*hL8eYaOW8yUpCzZDUPZXSA.jpeg Source: TIOBE

Google Trends also shows a stable interest in Julia over the years. https://miro.medium.com/max/1153/1*nIsvOaYZdfAYgcbuEiN32g.jpeg

But considering the feature set and the number of companies is working behind Julia such as NSF, DARPA, NASA, Intel, it is just a matter of when instead of if for Julia to make a breakthrough:

主要使用情境:

  • Scientific Computing
  • High-performance computing
  • Data Science
  • Visualization

主要競爭對手的語言:

  • Python
  • Matlab

If you found this helpful, please share it on your favorite forums (Twitter, LinkedIn, Facebook). If you are interested in Programming languages, you can also read my following articles:

https://medium.com/@md.kamaruzzaman/5-reasons-to-learn-a-new-programming-language-in-2020-bfc9a4b9a763

https://towardsdatascience.com/back-to-the-metal-top-3-programming-language-to-develop-big-data-frameworks-in-2019-69a44a36a842

https://towardsdatascience.com/programming-language-that-rules-the-data-intensive-big-data-fast-data-frameworks-6cd7d5f754b0



image