Google Announced Official Language For Android Development: Kotlin

Hi, welcome to KnowledgeSuttra. Google finally announced official language for Android Development is Kotlin.

Kotlin is expressive, concine and powerful and the main part about Kotlin which I love most is, it’s interoperable with our existing Android language and runtime. You can make Android apps using number of different programming languages, Including Scala, Clojure, C/C++, C# and Lua but now Google announced that Kotlin is official language for Android development which is alternative for the all programing language. As per my opinion Soon Kotlin going to oversees all the android development language. Let’s get started and understand why Kotlin is to powerful !!!…

Features Of Kotlin Over Java

 

1>   There are no checked exceptions

Kotlin does not have checked exceptions, so threw is no need to catch or declare any exceptions. If you’re sick of try/catch blocks cluttering up your Java code, then you’re going to be happy with this omission, however if you find that checked exceptions encourage you to think about error recovery and ultimately push you towards creating more robust code, this as an area where Java has the edge over Kotlin.

2> Native support for delegation

Kotlin’s class delegation is an alternative to inheritance that makes it possible to use multiple inheritance. Kotlin, unlike Java, supports the ‘composition over inheritance’ design pattern, via first-class delegation. Delegation is where a receiving object delegates operations to a second delegate object, it is a helper object with the original context.


kotlin
Kotlin android development language

3> Succinct Code Without Using “findViewById”

Comparison of Kotlin class and Java class the performing the same work, but Kotlin can reduce the amount of boilerplate code finfViewById ,Kotlin Android Extensions allows to import reference to a View into your Activity file. You will never have to write findViewById method again! You can access this TextView using just its ID.

 

4> Kotlin is null safe by default

In Kotlin, unable to hold a null value by default. If you try to assign or return null in your Kotlin code, then it’ll fail at compile-time.

 

5> Extension Functions

Kotlin gives developers the ability to extend a class with new functionality, which is ideal if there’s a class that you always felt was missing an important method!

 

6> Support for constructors

Unlike Java, a Kotlin class can have a primary constructor and one or more secondary constructors, which you create by including them in your class declaration.

 

7> No support for implicit widening conversions

Kotlin doesn’t support implicit widening conversions for numbers, so smaller types aren’t implicitly converted to bigger types. In Kotlin, if you want to assign a value of type Byte to an Int variable, then you’ll need to perform an explicit conversion, whereas Java has support for implicit conversions.

 

8> Annotation processing libraries with Kotlin

Kotlin supports all existing Java frameworks and libraries, including advanced frameworks that rely on annotation processing, although some Java libraries are already providing Kotlin extensions, such as RxKotlin.

From all this features, do you think to change your programing language from java to Kotlin!!!

Comment down below your favourite development And Feel free to give us a feedback

 

Thanks #teamKnowledgeSuttra

Sharing is caring!

Leave a Reply