Learn Kotlin Online In 25 Hours
Written by Mike James   
Tuesday, 30 July 2019

A course introducing Kotlin to experienced Java developers with Kotlin's lead developer as one of the instructors is available on the Coursera platform. Sounds too good to miss. So we tried it.

Kotlin for Java Developers comes from JetBrains, where Kotlin originated. It is taught by Andrey Breslav, who has been leading the design and development of the Kotlin Programming Language since 2010 when the project started, together with Svetlana Isakova who in addition to working on the Kotlin language co-authored the books 'Kotlin in Action' and 'AtomicKotlin' and, as a Developer Advocate, now spends her time teaching and speaking at conferences.

Although billed as a five-week course, as it is self-paced you can choose to go as fast or slow as you like and the five modules differ in the effort required.

Despite being labeled Week 1 the Introduction, which consists of four videos in which Andrey Breslav explains what is Kotlin and outlines its history, amount to just 13 minutes but it certainly conveys the impression that Kotlin is special and motivates learning more.

From here on in Svetlana Isakova takes over and the emphasis soon turns to code.

kotlincoursera

Week 2: Starting up with Kotlin is expected to take around 4 hours with 17 short videos to watch. The first one of these opens:

It's really easy to start using Kotlin, especially if you're a Java developer. You can use all the existing Java frameworks and libraries from Kotlin. You can even mix Kotlin and Java code in one project. Kotlin is a JVM language so you can easily call Java code from Kotlin,but that also works in the other direction. Kotlin is designed so that using all its features from Java is straightforward. That means, that you can make the transition from Java to Kotlin very slow by adding new features to your existing Java application written in Kotlin.

After this the module looks at introducing Kotlin to an existing project; gives a "Hello, world2 example and then goes on to the "nuts and bolts" of the language, pointing out the contrasts with Java where appropriate.

The learning outcomes for this stage are: 

  • Convert Java code to Kotlin automatically
  • Define variables and functions
  • Use control structures
  • Employ ranges
  • Explain what is an extension function in Kotlin
  • Define and use extensions

Each of the videos includes multiple choice quiz questions to check you understanding and every now and then you'll find yourself in the "Kotlin Playground" where you are asked to implement, or change a function by editing the code provided and running the code to see if it works. Svetlana Isakova walks through solutions to each of these - although these are not necessarily unique.

The first programming assignment comes at the end of Week 2, and is a mastermind game.  You solve the assignments using JetBrains EduTools plugin for IntelliJ IDEA or Android Studio and there's a tutorial to show you how this works. To gain access to the programming assignments, two of which are included in each of the subsequent weeks, you'll have to purchase the course ($49). The solutions of the assignments are also only accessible to paid learners - scholarships are available to students who can't afford the very moderate fee.

The topics and learning objectives of the final three weeks, each of which is expected to require 7 hours of effort are:

  • Week 3: Nullability, Functional Programming
    • Distinguish nullable types and non-nullable types
    • Use different ways to perform an action only when a value of a nullable type is not null
    • Prefer safe operations for nullable values
    • Employ functional programming style for manipulating collections
    • Use function types
    • Choose the right form of return expression for returning from lambda

  • Week 4: Properties, OOP, Conventions
    • Distinguish between different kinds of properties: without backing field, lazy, lateinit
    • Summarize the differences in defining and using classes with Java
    • Know the different syntax for constructors
    • Use different kinds of classes for correct situations: enum, data, inner, sealed
    • Use annotations to improve Java interoperability
    • Explain the difference between object expression and object declaration
    • Show the benefits of companion objects over static methods
    • Give examples of using conventions in the standard library
    • Employ conventions for your own classes

  • Week 5: Sequences, Lambdas with Receiver, Types
    • Use short simple function from the standard library
    • Explain why simple library functions bring no performance overhead
    • Demonstrate how inlining works

    • Describe the difference between operations on Collections and operations on Sequences

    • Convert a chained call from Collections to Sequences

    • Recognize lambdas with receiver in the code: in the standard library and different DSLs

    • Illustrate in what sense lambdas with receiver are similar to extensions

    • Show the Kotlin type hierarchy

    • Explain the difference between Unit and Nothing types

    • Recognize platform types: the types that came from Java

    • Prevent NPEs for mixed Kotlin and Java code

This is a well-structured course and the Programming Assignments really do put you through your paces. I'd would have liked more of the high level view from Andrey Breslav to inject more of the wow factor. Kotlin is special but possibly if you work with it for long enough you just take it for granted.  

 

  • Mike James is the author of The Programmer's Guide to Kotlin and Android Programming in Kotlin: Starting With An App from the I Programmer Library, many extracts from which are available on this site.

 

More Information

Kotlin for Java Developers

Related Articles

Refactoring to Kotlin Codelab

Udacity's Developing Android Apps with Kotlin 

The Programmers Guide To Kotlin - Inline Functions

Android Programming In Kotlin: Events

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

Banner


WasmCon 2023 Sessions Now Online
01/03/2024

The recorded session of the premier conference for technical developers and users interested in exploring the potential of WebAssembly are now online.



TypeScript 5.4 Adds NoInfer Type
12/03/2024

TypeScript 5.4 has been released, with the addition of a NoInfer utility type alongside preserved narrowing in closures following last assignments. 


More News

raspberry pi books

 

Comments




or email your comment to: comments@i-programmer.info

 

<ASIN:1871962536>

<ASIN:1617293296>

 

Last Updated ( Tuesday, 30 July 2019 )