Sponsored Links
-->

Monday, March 5, 2018

Kotlin is now an officially-supported programming language for ...
src: 9to5google.files.wordpress.com

Kotlin is a statically-typed programming language that runs on the Java virtual machine and also can be compiled to JavaScript source code or use the LLVM compiler infrastructure. Its primary development is from a team of JetBrains programmers based in Saint Petersburg, Russia. While the syntax is not compatible with Java, Kotlin is designed to interoperate with Java code and is reliant on Java code from the existing Java Class Library, such as the collections framework. Kotlin uses aggressive type inference to determine the type of values and expressions for which type has been left unstated. This reduces language verbosity relative to Java, which demands often entirely redundant type specifications.

As of Android Studio 3.0 Kotlin is a fully supported programming language on Android and lets the user choose between targeting Java 6- or Java 8-compatible bytecode.


Video Kotlin (programming language)



History

In July 2011 JetBrains unveiled Project Kotlin, a new language for the JVM, which had been under development for a year. JetBrains lead Dmitry Jemerov said that most languages did not have the features they were looking for, with the exception of Scala. However, he cited the slow compile time of Scala as an obvious deficiency. One of the stated goals of Kotlin is to compile as quickly as Java. In February 2012, JetBrains open sourced the project under the Apache 2 license.

The name comes from Kotlin Island, near St. Petersburg. Andrey Breslav mentioned that the team decided to name it after an island just like Java was named after the Indonesian island of Java (though the programming language Java was perhaps named after the coffee.)

JetBrains hopes that the new language will drive IntelliJ IDEA sales.

Kotlin v1.0 was released on February 15, 2016. This is considered to be the first officially stable release and JetBrains has committed to long-term backwards compatibility starting with this version.

At Google I/O 2017, Google announced first-class support for Kotlin on Android.

Kotlin v1.2 was released on November 28, 2017. Sharing Code between JVM and Javascript platforms feature was newly added to this release.


Maps Kotlin (programming language)



Philosophy

Development lead Andrey Breslav has said that Kotlin is designed to be an industrial-strength object-oriented language, and a "better language" than Java, but still be fully interoperable with Java code, allowing companies to make a gradual migration from Java to Kotlin.


Kotlin Programming Language HindiUrdu 16# Function with if else ...
src: i.ytimg.com


Syntax

Kotlin variable declarations and parameter lists have the data type come after the variable name (and with a colon separator), similar to Pascal. As in Scala and Apache Groovy, semicolons are optional as a statement terminator; in most cases a newline is sufficient for the compiler to deduce that the statement has ended.


Hello, Kotlin: Another programming language for JVM and JavaScript ...
src: regmedia.co.uk


Semantics

In addition to the classes and methods (called member functions in Kotlin) of object-oriented programming, Kotlin also supports procedural programming with the use of functions. As in C and C++, the entry point to a Kotlin program is a function named "main", which is passed an array containing any command line arguments. Perl and Unix/Linux shell script-style string interpolation is supported. Type inference is also supported.

Hello, world! example

Kotlin features in a hello world example

Variables in Kotlin can be immutable, declared with the val keyword or mutable, declared with the var keyword.

Kotlin makes a distinction between nullable and non-nullable data types. All nullable objects must be declared with a "?" postfix after the type name. Operations on nullable objects need special care from developers: null-check must be performed before using the value. Kotlin provides null-safe operators to help developers:

  • ?. (safe navigation operator) can be used to safely access a method or property of a possibly null object. If the object is null, the method will not be called and the expression evaluates to null.
  • ?: (null coalescing operator) often referred to as the Elvis operator:

An example of the use of the safe navigation operator:

Kotlin provides support for higher order functions and Anonymous functions or lambdas.

Lambdas are declared using braces, { } . If a lambda takes parameters, they are declared within the braces and followed by the -> operator.


Kotlin Programming Language Hindi/Urdu 6# if else expression ...
src: i.ytimg.com


Tools

  • IntelliJ IDEA has plug-in support for Kotlin. IntelliJ IDEA 15 is the first version to bundle the Kotlin plugin in the IntelliJ Installer, and provide Kotlin support out of the box.
  • JetBrains also provides a plugin for Eclipse.
  • Integration with common Java build tools is supported including Apache Maven, Apache Ant, and Gradle.
  • Android Studio (based on IntelliJ IDEA) has official support for Kotlin, starting from Android Studio 3.
  • Emacs has a Kotlin Mode in its Melpa package repository.

Android Now Officially Supports Kotlin Programming Language ...
src: s-media-cache-ak0.pinimg.com


Applications

One of the obvious applications of Kotlin is Android development. The platform was stuck on Java 7 for a while (with some contemporary language features made accessible through the use of Retrolambda or the Jack toolchain) and Kotlin introduces many improvements for programmers such as null-pointer safety, extension functions and infix notation. Accompanied by full Java compatibility and good IDE support (Android Studio) it is intended to improve code readability, give an easier way to extend Android SDK classes and speed up development.

Kotlin was announced as an official Android development language at Google I/O 2017. It became the third language fully supported for Android, in addition to Java and C++.


Kotlin Programming Language Hindi/Urdu 17# Function with Java ...
src: i.ytimg.com


Adoption

According to the Kotlin website, Prezi is using Kotlin in the backend. DripStat has done a writeup of their experience with Kotlin.

According to Jetbrains blog, Kotlin is used by Amazon Web Services, Pinterest, Coursera, Netflix, Uber, Square, Trello, Basecamp, and others. Corda, a distributed ledger developed by a consortium of well-known banks (such as Goldman Sachs, Wells Fargo, J.P. Morgan, Deutsche Bank, UBS, HSBC, BNP Paribas, Société Générale), has over 90% Kotlin in its codebase.

According to Google, Kotlin has already been adopted by several major developers -- Expedia, Flipboard, Pinterest, Square, and others -- for their Android production apps.


Kotlin Programming Language #18(Using IntelliJ): Nested Class and ...
src: i.ytimg.com


See also

  • Comparison of programming languages

Kotlin Programming Language #14(Using IntelliJ): Concept of ...
src: i.ytimg.com


References


Kotlin Programming Language Hindi/Urdu 7# Switch Case expression ...
src: i.ytimg.com


External links

  • Official website
  • Web-Demo and examples

Source of article : Wikipedia