Young Developer’s Love All New Android Kotlin

OFFICIAL LANGUAGE FOR ANDROID LANGUAGE

Google has unveiled in their I/O 2017 conference that Android team will officially support Kotlin programming language and got huge applause from the IT world. It is an open source project under Apache 2.0 license and built by JetBrains who earlier built IntelliJ. Google has announced that Kotlin is brilliantly designed, mature and will take android development to the next level as it is fast and fully supported by Java. Using Kotlin in Android development will be more fun. Young developers can develop now some awesome projects.

Android team is excited to announce that we are officially adding support for the Kotlin programming language.

Why Young Programmers should switch to Kotlin ?

1. 100% Java

You can really work on your old Java projects using Kotlin. All your favorite Java frameworks are still available, and whatever framework you’ll write in Kotlin is easily adopted by your Java.

2. Familiar Syntax

Kotlin isn’t a weird language. You don’t need to start from scratch, its syntax is familiar to Object Oriented Programing. There are of course some differences from Java such as the reworked constructors or the val var variable declarations. The snippet below presents most of the basics:

3. Smarter Than Java

It is smarter and more readable version of Java’s String.format() was built into the language.

4.  Smart Type Checking

5. Smart Type Casting

The Kotlin compiler tracks your logic and auto-casts types if possible, which means no more instanceof checks followed by explicit casts.

6. Equals or == ?

You don’t need to call equals() explicitly, because the == operator now checks for structural equality.

7. No Switch Case: A new WHEN Expression

The switch case is replaced with the much more readable and flexible when expression.

8.  No 100 Lines code

The Data Class, actually it is a POJO  with toString()equals()hashCode(), and copy() methods definition in it, so it won’t take up 100 lines of code like in Java.

9. No Nightmare called ‘null pointer exception’

Java is called statically typed language. A variable of type String is not guaranteed to refer to a String— it might refer to null. Sometimes Java developers used to live in fear of Null Pointer Exception. But not in the case of Kotlin.

Kotlin resolves this by distinguishing between non-null types and nullable types. Types are non-null by default, and can be made nullable by adding a ?

Kotlin forces you to guard against NPEs whenever you access a nullable type:

You might like

Leave a Reply

Your email address will not be published. Required fields are marked *