blah_blah_blog 2.0

Adam Adair's lousy blog and other assorted blather

That challenge of learning Kotlin

I was on the phone with my sister recently when she asked me how many programming languages I knew. It was a hard question to answer. In reality I have forgotten far more languages than I currently know, so I think my answer went something like I’m ready to do actual work in about 10 general purpose languages but I’ve worked in probably 25 languages. When I sat down and wrote down all the programming languages I’ve worked with the answer was actually over 30.

I have a method for learning new programming languages that has worked well for me over the years. The main method goes something like this:

  1. Get a good book that not only teaches the important syntax elements of the language but challenges you to write code on your own. Work through the book cover to cover.
  2. Use the programming language create a game or solve a fun AI problem.
  3. DO NOT TRY TO LEARN TWO LANGUAGES AT ONCE!!!!!

In recent years I’ve added a few supplementary steps like watching YouTube videos and entering code competitions to get up to speed quicker. These additional tools really helped me learn Python quickly.

A few months ago I set a personal goal to learn Kotlin, and it did not go well. Following my learning method I researched books and picked “Kotlin Programming: The Big Nerd Ranch Guide” by Josh Skeen and David GreenHaigh.. The book is well written and entertaining, and I would recommend it to anyone interested in Kotlin with the following caveat: You need to know Java well to get the most from this book. In fact, that is the problem I ran across with all learning material for Kotlin is that it requires you to be proficient in Java. I was certified in Java 1.2 by Sun Microsystems back in 2003, but Java is one of my “forgotten” languages having not done any professional work in it since 2006 and writing my last line of Java in 2009.

Once I finished working through the book I was not ready for step 2 of my method, and I quit. To be honest, at that time Kotlin looked weird to my brain. I also broke rule three of my method in that I was in the middle of a personal AI project in the Go language. I quickly forgot what little Kotlin I had learned.

A couple weeks ago I decided to try again. This time I tried something different, and a paid for a course on Coursera called “Kotlin for Java Developers”. I was worried because I wasn’t really a Java Developer any more, but I took a chance and I was pleasantly surprised. The course is intended to last five weeks but I knocked it out in 5 days. It was an enjoyable experience and I wish that had been where I started with the language.

Now I am at step two of the method, and I need to create something for me in the language and I am having an unusual problem: I can’t think of a good way to use this language. Kotlin seems to be a language with a purpose, and that purpose is to replace Java in the Android ecosystem, but I have no interest in Android programming. The other thing that makes Kotlin a challenge is that while it is technically a general purpose programming language it is very much tied to Jet Brains IntelliJ IDE. Kotlin support in other IDEs is minimal at best. This has required me to learn a new development environment, and build system. I’ve even taken a short course on Gradle. I feel like I’ve learned a lot, but now I have no where to go with that new found knowledge.