Search This Blog

Thursday, April 7, 2016

Kotlin advanced - language reference for android developers


Kotlin - one of the popular programming languages built on top of Java that runs on JVM.

As a mobile team we got interested in Kotlin a few months before its final release which gave us time to test it thoroughly before production use. The language has some clear advantages for an Android programmer - it enables migration from Java projects that have been under development for some time already. Java&Kotlin coexistence simplifies Kotlin introduction as only new functionality is written in JetBrain’s new language leaving all the legacy code untouched.

Transitioning gives the developer an opportunity to use lambdas, new syntax for data objects, extension functions to easily expand Android SDK’s classes functionality and infix notation to write DSL-like structures. Almost all the libraries you use today will work with Kotlin thanks to 100% Java compatibility. The same is true for Android SDK classes - all of them will seamlessly work with the new programming language. Kotlin gives you more choice when it comes to reflection, creating documentation and being null-pointer safe. Android works great with it out of the box so you won’t need to change your development habits.

Our production project in Kotlin turned out to be a success after 4 months of development. We had 0 bugs related to Kotlin as a programming language. Our code footprint is almost 30% smaller thanks to JetBrain’s, we benefit from nullpointer safety, closures, translated enums, data objects and use infix notation for logging and displaying Snackbars.

Kotlin advanced - language reference for android developers

Second talk on Kotlin language we had at STXNext. We try go deeper into language specifics and look at the positive impact new syntax can have on boilerplate removal and readability improvement. Kotlin really shines in Android development when one looks at “Enum translation”, “Extension functions”, “SAM conversions”, “Infix notation”, “Closures” and “Fluent interfaces” applied to lists. The talk, however, compares language-specifics of Java & Kotlin in terms of “Type Variance”, “Generics” and “IDE tools” as well.



5 comments:


  1. This waterproof 500 meters watch, not only replica rolex to Hold live in the sea to play the needs of water, even if rolex replica you dive to the bottom of the sea is no problem. Oris to create the depth of the table method is quite surprising to win: 12 swiss replica watches points in the mirror set up a hole, along the outer edge of the mirror embedded channel. The aperture allows the water replica watches to enter the channel and a yellow depth mark on the dial to indicate the water level, giving the diver a clear reading of up to 100 meters.

    ReplyDelete
  2. Great and useful article. Creating content regularly is very tough. Your points are motivated me to move on
    SEO Company in Chennai

    ReplyDelete
  3. wow its great thing and wish to you do more level of things and i am waiting to get your new ideas. keep share more things.
    seo company in india

    ReplyDelete
  4. I think like I get a clear cut understanding while reading the content than anywhere else. Keep continuing this journey...!

    Pawn Shops in Montgomery

    Pawn Shops in Birmingham

    Pawn Shops in Mobile

    ReplyDelete

If you like this post, please leave a comment :)