3 Презентация kotlin - why not?

Post on 26-Jan-2017

28 Views

Category:

Education

2 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Why not?

Why Kotlin

• Simple• IDE• Compatible with Java• Concise• Null-safety

Variables and data types

Unit

Functions

Functions

Android extensions

Classes and Inheritance

With Kotlin, you can do more with less code

With Kotlin, you can do more with less code

You can avoid NullPointerException

You can avoid NullPointerException

Elvis-operator

You can get rid of util classes

Collections in Kotlin

Creation (Immutable)

• listOf(1, 2, 3)• mapOf(1 to “A”, 2 to “B”)• setOf(“One”, “Two”, “Three”)

Creation (Mutable)

• mutableListOf(1, 2, 3)• mutableMapOf(1 to “A”, 2 to “B”)• mutableSetOf(“One”, “Two”, “Three”)

any

all

count

fold

forEach forEachIndexed

filter, filterNot, filterNotNull

map and flatMap

You can work with collections much more easily

You can work with collections much more easily

You can forget about view binding

Lambdas and high-order functions

Inline functions

• let

Inline functions

• with

Inline functions

• apply

https://kotlinlang.org/

top related