Kotlin language as the new official language of Android

Source: Internet
Author: User

Apple replaces object-c with Swift as the official language; Google has just completed IO Congress also announced the use of Kotlin as the official language to replace Java. Tool or Xcode, Android Studio.

From the famous IDE IntelliJ idea (Android Studio based on this development) software development company JetBrains (located in Eastern Europe, Czech Republic) originated from JetBrains's team of St. Petersburg, named after a small island near St. Petersburg (Kotlin ISL and).

Introduced:

Kotlin This is a JVM-based static type programming language with features such as utility and efficiency, developed by JetBrains.

Kotlin can be compiled into Java bytecode or compiled into JavaScript for easy running on devices without a JVM.

JetBrains, as the current provider of the popular Java IDE IntelliJ, has open source its Kotlin programming language under the Apache license.

Kotlin has officially become the official Android development language.

Grammar and Features:

Similar to ES6, developed using Java-like syntax and front-end technical syntax ....

(React native and Weex and IONIC3 are all mixed development)

    • Kotlin supports type inference and is not verbose like Java.

    • In addition, the variable is represented by Var, and Val indicates a more concise constant.

    • The method is also very simple, even the function is abbreviated into fun, adding a few pun meaning.

    • Class inheritance and implementation is simple, use: you can

    • Kotlin do not need to add semicolons to each sentence (;)

    • The Kotlin hollow pointer anomaly is well resolved.

    • Support Method Extension this

    • LAMBDA, higher-order functions, Streams API, functional programming support

    • The so-called high-order function is: You can accept a function as a parameter or return a function as a result

    • String templates

    • Good interoperability with Java (both Kotlin and Java belong to the JVM-based programming language)

(Kotlin and Java are very interactive and can be said to be seamlessly connected.) This is reflected in:

    • Kotlin is free to reference Java code, and vice versa.

    • Kotlin can have all of the existing Java frameworks and libraries

    • Java files can be easily converted to Kotlin with IntelliJ plugins

Kotlin widely used:

Kotlin supports a wide range of Android application development tools, such as Kotterknife (Butterknife Kotlin), Rxkotlin,anko, and of course, many of the existing Java libraries are available.

In addition, Kotlin can also be compiled into Javascript. Recently, using Kotlin to write a code to grab the proxy, the implementation is very fast. It's even faster than plain JavaScript. )

Performance:

The execution efficiency of Kotlin and the execution efficiency of Java code are theoretically consistent. Sometimes Kotlin may seem a bit higher, for example, Kotlin provides the inline setting of the method, and can set some high-frequency methods for inline operation, which reduces the overhead of the runtime's stack-in and save state.

Its concise grammar, the collection of many features, high efficiency and so on, has been in foreign countries, foreign pintereset, Square, Flipboard and other companies have begun to apply to production.

About Steering Kotlin:

is not the choice of Kotlin means to abandon Java, calm down to think, in fact, is not so, because Kotlin and Java grammar is too close, and in Kotlin in the time and Java related things to deal with, so this concern is not a problem.

Example: HTTPS://GITHUB.COM/XIEHUI999/KOTLINFORANDROID Project structure:

Kotlin language as the new official language of Android

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.