Skip to content

Instantly share code, notes, and snippets.

@kibotu
Last active January 11, 2020 14:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kibotu/ecefaace0a41333793815413bc06efdd to your computer and use it in GitHub Desktop.
Save kibotu/ecefaace0a41333793815413bc06efdd to your computer and use it in GitHub Desktop.
Kotlin Notes

Kotlin

What's Kotlin?

https://www.reddit.com/r/Kotlin/comments/5ob11m/hello_is_this_an_anime_channel/?st=iy06bsjt&sh=348cd13c https://news.ycombinator.com/item?id=10642280

Presentation

When

Why

  • Interoperable: Kotlin can be freely mixed with Java,
  • Safe: statically check for common pitfalls (e.g., null pointer dereference) to catch errors at compile time,
  • Less typing. Kotlin has more concise syntax than Java,
  • Toolable: enable precise and performant tools such as IDEs and build systems,
  • Open Source under Apache 2 License: https://github.com/JetBrains/kotlin (currently ~36k commits, ~700 branches, ~7k releases, 140 contributors, ~1k closed pull-requests)
  • "Democratic": make all parts of the language available to all developers (no policies are needed to restrict the use of some features to library writers or other groups of developers).

Compatiblity

kotlin-1-0-beta-4-is-out

My favorite features

  • Data Classes

  • Null Safety The Billion Dollar Mistake

  • Extension Functions

  • Smart Casts

  • Functional Programming

  • When

  • stdlib

  • Default Arguments

  • Named Arguments

  • Preventing Leaks

    val notEmpty: (String) -> Boolean { !it.isEmpty() }

examples

Testing

Getting started

https://kotlinlang.org/docs/tutorials/getting-started.html

convert java to kotlin

For Android

Also notable

Slack

http://slack.kotlinlang.org/

Kotlin-Berlin Meetup Group

https://www.meetup.com/kotlin-berlin/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment