kotlin

Why Kotlin ?

  1. Traditionally java 6 was the Language used by the android
  2. Kotlin files have extension of .kt
  3. Kotlin was developed by IntteliJ in 2011 but it got famous after android announced kotlin as official language
  4. Kotlin is used in server side coding and mobile applications
  5. Kotlin is easy and Interoperable with java
  6. Kotlin will do everything that java was able to do and more
  7. Kotlin compiler check the type safety
  8. Kotlin tries to remove the null pointer issues
  9. You cam mix up the Java and kotlin
  10. You can reduce the number of lines used to achieve the gal compared with Java

Feature of Kotlin

  • Static Typing : Types of variable are checked during the compile time, which increases the performance of the language. Fewer hang-ups during the run time
  • Var : Compiler find the data type from the context of the usage during the compile time
  • OOP & Functional : Kotlin is Object oriented language and supports functional language concepts
  • lambdas : Kotlin supports Lambda, we can write function using lambda
  • Nullability : Kotlin provides null safety
  • Operator Overloading : We can redefine the purpose of the operator like arithmetic and logical operator
  • generics :
  • Reflection : Compile time modifications
  • Free and Open Source :

Disadvantages of Kotlin

  • Checked exception are not available
  • Primitive types are not classes

Softwares to install


1. Install Latest JDK and set Java in Path variable
2. Install IntelliJ IDE for code development

Why Google chose kotlin

Google did not replace Java, they added Kotlin official support.

    This is an idea of why they did it:
  1. Kotlin can target JVM 1.6 with it's latest version of the language. That means you can use lambdas and other modern language features and still target an old version of Java.

    In contrast, if you want to use lambdas in Java, you need to use Java 8, and then modify the generated classes to convert then to old versions of bytecode.

    Although some developers were using tools like retrolambda for that, official support only came in Android studio 3.0, released a few days ago.
  2. Kotlin, although more modern than Java language, is very close to Java. code generated with Kotlin only requires a small runtime on top of Java.

    And the generated code is equivalent in performance than code written in Java. in contrast, most other languages that target the JVM are either slower or have a big runtime. Mobile apps are impacted by these issues.
  3. Kotlin is maintained by JetBrains, the same company that produces IntelliJ, which is the core of Android Studio.

    Google and JetBrains already have a great collaboration because of the IDE. And JetBrains already supports Kotlin plugins on top of IntelliJ and Android Studio.
  4. Due to #1 and #2, a lot of developers from important companies in the Android ecosystem were already using Kotlin, and requesting Kotlin official support.

About Author

Myself KarthiQ, I am the author of this blog, I know ways to write a good article but some how I donot have the skills to make it to reach people, would you like help me to reach more people By sharing this Article in the social media.

Share this Article Facebook
Comment / Suggestion Section
Point our Mistakes and Post Your Suggestions
Copyright © CherCher Tech