• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Kotlin and You, why?

 
Bartender
Posts: 1868
81
Android IntelliJ IDE MySQL Database Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As shown with last week's promotion there appears to be a growing interest in Kotlin.
My question is why are You interested in Kotlin?

My reasons are:
- I'm trying to become an Android developer and in May 2017 at Google I/O 2017 it was announced that Google/Android is supporting Kotlin as a development language for Android development.
- I saw this post by Liutauras Vilda: https://coderanch.com/t/684277/Recording-Devoxx-UK-Kotlin-Ready which has a video going over some of Kotlin's features and it interested me.
 
Rancher
Posts: 379
22
Mac OS X Monad Clojure Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm a Clojure developer and I'm very happy with Clojure (I've been using it in production since 2011 now). One of the Clojure IDEs is Cursive, which is a plugin built on IntelliJ's IDE, and the author of Cursive, Colin Fleming, has started using Kotlin to minimize the Null Pointer Exceptions he gets when trying to work with the IntelliJ code from Clojure (idiomatic Clojure embraces null and uses it in very specific ways -- Java API code tends to throw nulls at you all the time and wrapping that in Clojure leads to non-idiomatic Clojure code that is overly focused on null handling!). Colin's enthusiasm for Kotlin has fascinated me for a while so, along with the Pragmatic Programmer's advice to learn a new language every year, this seems like a great opportunity to dig deeper into Kotlin.

I very much doubt I'd want to switch from Clojure to Kotlin but it never hurts to know another language -- and I've worked with Java, Groovy, and Scala on the JVM prior to picking up Clojure.

So far I'm still working through the Kotlin website, learning the language, but I'm quite impressed with the simplicity that Kotlin has achieved compared to Java, and I love the way it has extended a number of (ugly) Java standard library classes with convenience methods that make using those classes so much more natural and fluid (the I/O stuff in particular).
 
Pete Letkeman
Bartender
Posts: 1868
81
Android IntelliJ IDE MySQL Database Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Interesting. I've heard of, but have not looked into Clojure or even seen of line of code of Clojure.
If you are using IntelliJ based IDE then I can tell you that at least in Android Studio with a few clicks you can turn your Java code into Kotlin.
However, from what I can tell, this is a one way conversion, so back up your code before beginning.
As far as I know JetBrains is also maintaining a Kotlin plugin for Eclipse and this may work similar to how it works in Android Studio.

One way that you could start would be to first write your code in Java and then convert it to Kotlin.
I did this recently and for one POJO when converted the amount of code in Kotlin was less then 50% of the Java code.

All that said, I haven't really done that much in Kotlin nor have I tried out the samples on the web site, so you are at least a head of me.
 
Sean Corfield
Rancher
Posts: 379
22
Mac OS X Monad Clojure Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Pete Letkeman wrote:If you are using IntelliJ based IDE then I can tell you that at least in Android Studio with a few clicks you can turn your Java code into Kotlin.


I don't like IDEs in general (and I dislike IntelliJ particularly), and I have no Java code to convert. Funnily enough tho', I just installed the latest version of IntelliJ yesterday to work on an issue with Cursive and Expectations (a BDD-style testing library I maintain in Clojure). Despite that, and my current ongoing process of learning Kotlin, it hadn't even occurred to me to try out IntelliJ's Kotlin support!

I use Atom for all my editing with ProtoREPL for Clojure. I should check to see what sort of Kotlin support it has (I've been writing Kotlin so far with whatever defaults Atom uses).
 
reply
    Bookmark Topic Watch Topic
  • New Topic