Skip to content
This repository has been archived by the owner on Feb 21, 2023. It is now read-only.

Latest commit

 

History

History
57 lines (48 loc) · 4.02 KB

kotlin_guide.md

File metadata and controls

57 lines (48 loc) · 4.02 KB

Kotlin guide

This guide is designed to help you get started with Kotlin, the language we write most of our code in, and to introduce you to some intermediate topics.

Getting Started

There are multiple ways to get started with Kotlin, depending on how you like to learn. If you like:

  • Learning while coding, try the Kotlin Koans online or in the IDE. Kotlin Koans are a series of exercises to get you familiar with the Kotlin syntax. Each exercise is created as a failing unit test and your job is to make it pass.
  • Reading documentation, the official Kotlin docs are good: start at Basic Syntax and work your way through the pages in the side bar
  • Reading books, try Kotlin in Action. If you're an SF employee, we have this on the bookshelf, as well as Kotlin Programming: The Big Nerd Ranch Guide.
  • Comparing Swift & Kotlin: Swift is like Kotlin This site provides a ton of examples of how Swift code looks in Kotlin. If you're comfortable with Swift (or moving from iOS development) this is a great resource for you!

Once you've gained some basic familiarity with the language, you can gain more experience by:

You should also take a look at the official style guides:

Staying Informed

If you like staying up-to-date on the latest Kotlin topics, members of our team recommend:

Intermediate Topics

You can see what the Kotlin compiler is doing under the hood (e.g. is this lambda performant? What does it keep a reference to?) by using "Show Kotlin Bytecode" and then "Decompile" back to Java.

Writing Domain Specific Languages (DSLs) is a neat feature in Kotlin: there's a chapter near the end of Kotlin in Action if you want to read about it.

Coroutines

The official documentation on coroutines is really good:

If you'd prefer to get started with videos, this KotlinConf 2017 talk is a great place to get started.