I have started a repo for example Kotlin code https://github.com/DaddyOh/kotlin-Examples
I would love feedback, contributions, pull requests.
The code examples I’m adding to the repo are to show other people who are not heaveywwieght pogrammers how to use Kotlin. I’m guessing that for 98% of you on this forum this will seem like childs play. But for those of us that just want to learn how to use Kotlin, my hope is this will be of great benefit. I intend to add a few examples every week and some weeks might be able to add a lot more.
Some background
I’m not a heavyweight programmer. I lead a small (tiny) web developement shop (php) and am a scrum coach for the whole web team (12 people) where I work. I write mostly helper code, data file transforms, xml transforms, and some other middle-ware “stuff”. I code in Java, Groovy, Project R, xQuery, and php mostly.
I have a love hate relationship with Java and Groovy (mostly hate php). My interest with Kotlin is with Java Interoperability and eventual Java replacement.
Kotlin
Wow - I really love the ability to build utility functions and extend objects with the “dot” notation like String.getCharAt(position : Int) and I’m excited to have a statically typd language that I can create high order functions as closures. In fact there is one closure I created in the above repo to show how it is done. (String.eachChar(){})
Having functions outside of classes and a more concise and rich language than Java is what I have been looking for.
I starting playing last week with kotlin and have already written a text file analysis program to prep some performance metrics for analysis in Project-R. 62 lines of code that would have been at least twice as long in Java. SImple yes, statisfying, absoluately.
Keep up the good work.
Eric Palmer
http://www.richmond.edu/