SlideShare a Scribd company logo
otlin
A Language we should know it exists
Kotlin
Agenda:
● What is Kotlin
● 10 Features You will Love about Kotlin
● Gradle goes Kotlin
What is otlin?
What is Kotlin
What is Kotlin
What is Kotlin
● Statically typed programming language targeting JVM, JavaScript
● Started in 2010 by the JetBrains
● They needed a language:
○ Expressive, Toolable, Interoperable, Pragmatic
● 100% interoperable with Java
● KClasses are compiled to Java bytecode (Java 6+)
What is Kotlin
What is Kotlin
“Kotlin is not business model for JetBrains, it is a tool to create business
tools in more efficient language”
What is Kotlin
“Kotlin is designed to be an industrial-strength object-oriented language,
and to be a better language than Java but still be fully interoperable with
Java code, allowing companies to make a gradual migration from Java to
Kotlin.” – Andrey Breslav, Development Lead for Kotlin
What is Kotlin
What is Kotlin
Who officially using Kotlin
What is Kotlin
What is Kotlin
Kotlin 1.0
● February 15, 2016 (after 6 years)
Kotlin 1.1
● March 1, 2017
Kotlin 1.1.2
● April 25, 2017
What is Kotlin
Kotlin on Android now (17.5.2017 Google I/O 17) official
What is Kotlin / Demo
public void updateWeather(int degrees) {
String description;
Color color;
if (degrees < 5) {
description = "cold";
color = Color.BLUE;
} else if (degrees < 23) {
description = "mild";
color = Color.ORANGE;
} else {
description = "hot";
color = Color.RED;
}
}
You can do better with Kotlin by Svetlana Isakova
What is Kotlin / Demo
public void updateWeather(int degrees) {
String description;
Color color;
if (degrees < 5) {
description = "cold";
color = Color.BLUE;
} else if (degrees < 23) {
description = "mild";
color = Color.ORANGE;
} else {
description = "hot";
color = Color.RED;
}
}
fun updateWeather(degrees: Int) {
val description: String
val color: Color
if (degrees < 5) {
description = "cold"
color = Color.BLUE
} else if (degrees < 23) {
description = "mild"
color = Color.ORANGE
} else {
description = "hot"
color = Color.RED
}
}
What is Kotlin / Demo
public void updateWeather(int degrees) {
String description;
Color color;
if (degrees < 5) {
description = "cold";
color = Color.BLUE;
} else if (degrees < 23) {
description = "mild";
color = Color.ORANGE;
} else {
description = "hot";
color = Color.RED;
}
}
fun updateWeather(degrees: Int) {
val description: String
val color: Color
if (degrees < 5) {
description = "cold"
color = Color.BLUE
} else if (degrees < 23) {
description = "mild"
color = Color.ORANGE
} else {
description = "hot"
color = Color.RED
}
}
What is Kotlin / Demo
fun updateWeather(degrees: Int) {
val description: String
val color: Color
if (degrees < 5) {
description = "cold"
color = Color.BLUE
} else if (degrees < 23) {
description = "mild"
color = Color.ORANGE
} else {
description = "hot"
color = Color.RED
}
}
fun updateWeather(degrees: Int) {
val (description: String, color: Color) = if (degrees < 5) {
Pair("cold", Color.BLUE)
} else if (degrees < 23) {
Pair("mild", Color.ORANGE)
} else {
Pair("hot", Color.RED)
}
}
What is Kotlin / Demo
fun updateWeather(degrees: Int) {
val (description: String, color: Color) = if (degrees < 5) {
Pair("cold", Color.BLUE)
} else if (degrees < 23) {
Pair("mild", Color.ORANGE)
} else {
Pair("hot", Color.RED)
}
}
What is Kotlin / Demo
fun updateWeather(degrees: Int) {
val (description, color) = if (degrees < 5) {
Pair("cold", Color.BLUE)
} else if (degrees < 23) {
Pair("mild", Color.ORANGE)
} else {
Pair("hot", Color.RED)
}
}
What is Kotlin / Demo
fun updateWeather(degrees: Int) {
val (description, color) = if (degrees < 5) {
Pair("cold", Color.BLUE)
} else if (degrees < 23) {
Pair("mild", Color.ORANGE)
} else {
Pair("hot", Color.RED)
}
}
What is Kotlin / Demo
fun updateWeather(degrees: Int) {
val (description, color) = when {
degrees < 5 -> Pair("cold", Color.BLUE)
degrees < 23 -> Pair("mild", Color.ORANGE)
else -> Pair("hot", Color.RED)
}
}
What is Kotlin / Demo
fun updateWeather(degrees: Int) {
val (description, color) = when {
degrees < 5 -> Pair("cold", Color.BLUE)
degrees < 23 -> Pair("mild", Color.ORANGE)
else -> Pair("hot", Color.RED)
}
}
What is Kotlin / Demo
fun updateWeather(degrees: Int) {
val (description, color) = when {
degrees < 5 -> "cold" to Color.BLUE
degrees < 23 -> "mild" to Color.ORANGE
else -> "hot" to Color.RED
}
}
What is Kotlin / Demo
fun updateWeather(degrees: Int) {
val (description, color) = when {
degrees < 5 -> "cold" to Color.BLUE
degrees < 23 -> "mild" to Color.ORANGE
else -> "hot" to Color.RED
}
}
public void updateWeather(int degrees) {
String description;
Color color;
if (degrees < 5) {
description = "cold";
color = Color.BLUE;
} else if (degrees < 23) {
description = "mild";
color = Color.ORANGE;
} else {
description = "hot";
color = Color.RED;
}
}
10 Features You will Love about Kotlin
1. Null Safety / 10 Features
var a: String = "abc"
a = null // compilation error
var b: String? = "abc"
b = null // ok
val x: String? = "Hi"
x.length // Does not compile.
val y: String = null // Does not compile.
1. Null Safety / 10 Features
var a: String = "abc"
a = null // compilation error
var b: String? = "abc"
b = null // ok
val x: String? = "Hi"
x.length // Does not compile.
val y: String = null // Does not compile.
1. Null Safety / 10 Features
var a: String = "abc"
a = null // compilation error
var b: String? = "abc"
b = null // ok
val x: String? = "Hi"
x.length // Does not compile.
val y: String = null // Does not compile.
1. Null Safety / 10 Features
var a: String = "abc"
a = null // compilation error
var b: String? = "abc"
b = null // ok
val x: String? = "Hi"
x.length // Does not compile.
val y: String = null // Does not compile.
1. Null Safety / 10 Features
var a: String = "abc"
a = null // compilation error
var b: String? = "abc"
b = null // ok
val x: String? = "Hi"
x.length // Does not compile.
val y: String = null // Does not compile.
1. Null Safety / 10 Features
var a: String = "abc"
a = null // compilation error
var b: String? = "abc"
b = null // ok
val x: String? = "Hi"
x.length // Does not compile.
val y: String = null // Does not compile.
1. Null Safety / 10 Features
var a: String = "abc"
a = null // compilation error
var b: String? = "abc"
b = null // ok
val x: String? = "Hi"
x.length // Does not compile.
val y: String = null // Does not compile.
1. Null Safety / 10 Features
if (x != null) {
x.length // Compiles! Not idiomatic just to get length!
}
// Same as above (IntelliJ auto-suggested the change).
x?.length
// Elvis operator.
val len = x?.length ?: -1
val len = x!!.length // Will throw if null. Rarely used
1. Null Safety / 10 Features
if (x != null) {
x.length // Compiles! Not idiomatic just to get length!
}
// Same as above (IntelliJ auto-suggested the change).
x?.length
// Elvis operator.
val len = x?.length ?: -1
val len = x!!.length // Will throw if null. Rarely used
1. Null Safety / 10 Features
if (x != null) {
x.length // Compiles! Not idiomatic just to get length!
}
// Same as above (IntelliJ auto-suggested the change).
x?.length
// Elvis operator.
val len = x?.length ?: -1
val len = x!!.length // Will throw if null. Rarely used
1. Null Safety / 10 Features
if (x != null) {
x.length // Compiles! Not idiomatic just to get length!
}
// Same as above (IntelliJ auto-suggested the change).
x?.length
// Elvis operator.
val len = x?.length ?: -1
val len = x!!.length // Will throw if null. Rarely used
2. Data Class
2. Data Class / 10 Features
● For simple classes which mainly hold data, we can avoid a lot of boilerplate
compared to Java code
2. Data Class / 10 Features
● For simple classes which mainly hold data, we can avoid a lot of boilerplate
compared to Java code
● Consider the following task:
○ Create Country object which holds data about id and name
2. Data Class / 10 Features
3. Data Class / 10 Features
3. Data Class / 10 Features
● Kotlin generate hashCode(), equals(), toString()
3. Data Class / 10 Features
● But that’s not all what we could with data classes!
○ We can easily make copies of data classes
3. Data Class / 10 Features
● But that’s not all what we could with data classes!
○ We can easily make copies of data classes
val customer = Customer(id = 2001,
name = "Vaclav Souhrada",
email = "vsouhrada@email.to")
3. Data Class / 10 Features
● But that’s not all what we could with data classes!
○ We can easily make copies of data classes
val customer = Customer(id = 2001,
name = "Vaclav Souhrada",
email = "vsouhrada@email.to")
val updatedCst = customer.copy(email = "vaclav_souhrada@email.com")
3. Data Class / 10 Features
3. Extension Functions
3. Extension Functions / 10 Features
● Kotlin allows us to extend the functionality of existing classes without inheriting from them.
fun String.capitalize(): String {
return this.toUpperCase()
}
3. Extension Functions / 10 Features
● Kotlin allows us to extend the functionality of existing classes without inheriting from them.
fun String.hello() {
println("Hello, $this!")
}
3. Extension Functions / 10 Features
● Kotlin allows us to extend the functionality of existing classes without inheriting from them.
fun String.hello() {
println("Hello, $this!")
}
fun String.and(input: String): String {
return "${this} $input"
}
3. Extension Functions / 10 Features
● Kotlin allows us to extend the functionality of existing classes without inheriting from them.
fun main(args: Array<String>) {
// prints VACLAV SOUHRADA
println("vaclav souhrada".capitalize())
"Vaclav".hello() // prints 'Hello, Vaclav!'
var testString = "This is a string".and("This is another")
println(testString) // prints 'This is a string This is another'
}
fun String.hello() {
println("Hello, $this!")
}
fun String.and(input: String): String
{
return "${this} $input"
}
3. Extension Functions / 10 Features
● Kotlin allows us to extend the functionality of existing classes without inheriting from them.
val gson = Gson()
3. Extension Functions / 10 Features
● Kotlin allows us to extend the functionality of existing classes without inheriting from them.
val gson = Gson()
fun Any.toJSON(): String {
return gson.toJson(this)
}
3. Extension Functions / 10 Features
● Kotlin allows us to extend the functionality of existing classes without inheriting from them.
val gson = Gson()
fun Any.toJSON(): String {
return gson.toJson(this)
}
val customer = Customer(id = 2001, name = "Vaclav Souhrada", email =
"vsouhrada@email.com")
3. Extension Functions / 10 Features
● Kotlin allows us to extend the functionality of existing classes without inheriting from them.
val gson = Gson()
fun Any.toJSON(): String {
return gson.toJson(this)
}
val customer = Customer(id = 2001, name = "Vaclav Souhrada", email =
"vsouhrada@email.com")
val json = customer.toJSON()
4. Smart Cast
4. Smart Cast / 10 Features
if (obj instanceof String) {
}
4. Smart Cast / 10 Features
if (obj instanceof String) {
System.out.println(((String) obj).length());
}
4. Smart Cast / 10 Features
if (obj instanceof String) {
System.out.println(((String) obj).length());
}
if (obj is String) {
}
4. Smart Cast / 10 Features
if (obj instanceof String) {
System.out.println(((String) obj).length());
}
if (obj is String) {
print(obj.length)
}
4. Smart Cast / 10 Features
if (obj instanceof String) {
System.out.println(((String) obj).length());
}
if (!(obj instanceof String)) {
System.out.println("Not a String");
}
if (obj is String) {
print(obj.length)
}
4. Smart Cast / 10 Features
if (obj instanceof String) {
System.out.println(((String) obj).length());
}
if (!(obj instanceof String)) {
System.out.println("Not a String");
}
if (obj is String) {
print(obj.length)
}
if (obj !is String) { // !(obj is String)
print("Not a String")
}
4. Smart Cast / 10 Features
if (obj instanceof String) {
System.out.println(((String) obj).length());
}
if (!(obj instanceof String)) {
System.out.println("Not a String");
} else {
System.out.println(((String) obj).length());
}
if (obj is String) {
print(obj.length)
}
if (obj !is String) { // !(obj is String)
print("Not a String")
}
4. Smart Cast / 10 Features
if (obj instanceof String) {
System.out.println(((String) obj).length());
}
if (!(obj instanceof String)) {
System.out.println("Not a String");
} else {
System.out.println(((String) obj).length());
}
if (obj is String) {
print(obj.length)
}
if (obj !is String) { // !(obj is String)
print("Not a String")
} else {
print(obj.length)
}
4. Smart Cast / 10 Features
if (obj instanceof String) {
System.out.println(((String) obj).length());
}
if (!(obj instanceof String)) {
System.out.println("Not a String");
} else {
System.out.println(((String) obj).length());
}
if (obj is String) {
print(obj.length)
}
if (obj !is String) { // !(obj is String)
print("Not a String")
} else {
print(obj.length)
}
4. Smart Cast / 10 Features
4. Smart Cast / 10 Features
4. Smart Cast / 10 Features
4. Smart Cast / 10 Features
5. Singleton
5. Singleton / 10 Features
SingletonInJava.getInstance().doSomething() SingletonInKotlin.doSomething()
6. Functional Programming
6. Functional Programming / 10 Features
● Combination of lambda expression and the Kotlin lib. makes our day easier
when we working with collections
val numbers = arrayListOf(10 ,5 , -9, 9, 11, 5, -6)
6. Functional Programming / 10 Features
● Combination of lambda expression and the Kotlin lib. makes our day easier
when we working with collections
val numbers = arrayListOf(10 ,5 , -9, 9, 11, 5, -6)
val nonNegative = numbers.filter { it >= 0}
println(nonNegative) // [10, 5, 9, 11, 5]
6. Functional Programming / 10 Features
● Combination of lambda expression and the Kotlin lib. makes our day easier
when we working with collections
val numbers = arrayListOf(10 ,5 , -9, 9, 11, 5, -6)
val nonNegative = numbers.filter { it >= 0}
println(nonNegative) // [10, 5, 9, 11, 5]
6. Functional Programming / 10 Features
● Combination of lambda expression and the Kotlin lib. makes our day easier
when we working with collections
val numbers = arrayListOf(10 ,5 , -9, 9, 11, 5, -6)
// Sum of all elements: 25
println(numbers.foldRight(0, { a, b -> a + b }))
6. Functional Programming / 10 Features
● Combination of lambda expression and the Kotlin lib. makes our day easier
when we working with collections
val numbers = arrayListOf(10 ,5 , -9, 9, 11, 5, -6)
// Sum of all elements: 25
println(numbers.foldRight(0, { a, b -> a + b }))
//20 10 -18 18 22 10 -12
numbers.forEach { println("${it * 2} ") }
6. Functional Programming / 10 Features
● Combination of lambda expression and the Kotlin lib. makes our day easier
when we working with collections
val numbers = arrayListOf(10 ,5 , -9, 9, 11, 5, -6)
// Sum of all elements: 25
println(numbers.foldRight(0, { a, b -> a + b }))
//20 10 -18 18 22 10 -12
numbers.forEach { println("${it * 2} ") }
val kindOfNumbers: Iterable<String> = numbers.filter { it < 0 }
.map { "$it is negative" }
6. Functional Programming / 10 Features
● Combination of lambda expression and the Kotlin lib. makes our day easier
when we working with collections
val numbers = arrayListOf(10 ,5 , -9, 9, 11, 5, -6)
// Sum of all elements: 25
println(numbers.foldRight(0, { a, b -> a + b }))
//20 10 -18 18 22 10 -12
numbers.forEach { println("${it * 2} ") }
val kindOfNumbers: Iterable<String> = numbers.filter { it < 0 }
.map { "$it is negative" }
println(kindOfNumbers) // [-9 is negative, -6 is negative]
7. Type Inference
7. Type Inference / 10 Features
● In Kotlin, you do not have to specify the type of each variable explicitly:
val name = "Vaclav" // val name: String = "Vaclav"
7. Type Inference / 10 Features
● In Kotlin, you do not have to specify the type of each variable explicitly:
val name = "Vaclav"
val age = 31
7. Type Inference / 10 Features
● In Kotlin, you do not have to specify the type of each variable explicitly:
val name = "Vaclav"
val age = 31
// Only need Iterable interface
val list: Iterable<Double> = arrayListOf(1.0, 0.0, 3.1415, 2.718)
7. Type Inference / 10 Features
● In Kotlin, you do not have to specify the type of each variable explicitly:
val name = "Vaclav"
val age = 31
// Only need Iterable interface
val list: Iterable<Double> = arrayListOf(1.0, 0.0, 3.1415, 2.718)
// Type is ArrayList
val arrayList = arrayListOf("Kotlin", "Scala", "Groovy")
8. Default Arguments
8. Default Arguments / 10 Features
In Java, we often have to duplicate code in order define different variants of a method or
constructor:
8. Default Arguments / 10 Features
All this stuff we can remove when we switch to Kotlin by using default arguments.
class OperatorInfoInKotlin(
val uuid: String = UUID.randomUUID().toString(),
val name: String,
val hasAccess: Boolean = true,
val isAdmin: Boolean = false,
val notes: String = "") {}
9. Named Arguments
9. Named Arguments / 10 Features
Default arguments become more powerful in a combination with named arguments:
OperatorInfoInKotlin(name = "Vaclav")
OperatorInfoInKotlin(name = "Vaclav", hasAccess = false, isAdmin = false, notes = "blabla")
new OperatorInfoInJava("Vaclav", false, false, "blabla");
10. Collections
10. Collections / 10 Features
● In Kotlin we have:
○ higher-order functions
○ lambda expressions
○ operator overloading
○ lazy evaluation
○ lots of others useful methods to work with the collection.
10. Collections / 10 Features
“What is an average age of employees in the company in Pilsen city?”
1.6 !!!public double getAverageAge(@NotNull List<Employee> employees) {
}
int ageSum = 0;
int count= 0;
for (Employee employee : employees) {
}
if ("Pilsen".equals(employee.getCity()) {
}
ageSum += employee.getAge();
count++;
if (count == 0) return 0
return ageSum / count;
10. Collections / 10 Features
“What is an average age of employees in the company in Pilsen city?”
fun getAverageAge(val employees: List<Employee>): Double {
}
.map{ it.age }employees.filter{ it.city == City.PILSEN } .average()return
10. Collections / 10 Features
“What is an average age of employees in the company in Pilsen city?”
public double getAverageAge(@NotNull List<Employee> employees) {
int ageSum = 0;
int count= 0;
for (Employee employee : employees) {
if ("Pilsen".equals(employee.getCity()) {
ageSum += employee.getAge();
count++;
}
}
if (count == 0) return 0
return ageSum / count;
}
fun getAverageAge(val employees: List<Employee>): Double {
return employees.filter{ it.city == City.PILSEN }.map{ it.age }.average()
}
10. Collections / 10 Features
For more info you can see a very nice blog post from Antonio Leiva
https://antonioleiva.com/collection-operations-kotlin/
11. Bonus
Bonus
Bonus
Bonus
Bonus
Bonus
Bonus
Gradle goes Kotlin
Gradle goes Kotlin
● Gradle is an advanced build management system based on Groovy
● Gradle is build tool with a focus on build automation for multi-language
development
● Official build tool for Android!
Gradle goes Kotlin
● Kotlin Meets Gradle (May 18, 2016)
○ Gradle and JetBrains announced a partnership to make Kotlin a first
class language for Gradle builds!
■ auto-completion and content assist
■ quick documentation
■ navigation to source
■ refactoring and more
Gradle goes Kotlin
Gradle goes Kotlin
import org.gradle.api.plugins.*
import org.gradle.api.tasks.wrapper.*
import org.gradle.script.lang.kotlin.*
group = "gradle-meets-kotlin"
version = "1.0.0-SNAPSHOT"
val kotlinVersion by extra.properties
apply {
plugin("application")
}
configure<ApplicationPluginConvention> {
mainClassName = "samples.HelloWorld"
applicationName = "gradle-meets-kotlin"
}
repositories {
jcenter()
mavenCentral()
}
dependencies {
"testCompile"("junit:junit:4.12")
}
Thank you
for your attention!
eman.cz

More Related Content

What's hot

Kotlin as a Better Java
Kotlin as a Better JavaKotlin as a Better Java
Kotlin as a Better Java
Garth Gilmour
 
Taking Kotlin to production, Seriously
Taking Kotlin to production, SeriouslyTaking Kotlin to production, Seriously
Taking Kotlin to production, Seriously
Haim Yadid
 
Kotlin boost yourproductivity
Kotlin boost yourproductivityKotlin boost yourproductivity
Kotlin boost yourproductivity
nklmish
 
Swift and Kotlin Presentation
Swift and Kotlin PresentationSwift and Kotlin Presentation
Swift and Kotlin PresentationAndrzej Sitek
 
Kotlin Slides from Devoxx 2011
Kotlin Slides from Devoxx 2011Kotlin Slides from Devoxx 2011
Kotlin Slides from Devoxx 2011Andrey Breslav
 
Kotlin: Challenges in JVM language design
Kotlin: Challenges in JVM language designKotlin: Challenges in JVM language design
Kotlin: Challenges in JVM language design
Andrey Breslav
 
Kotlin - Better Java
Kotlin - Better JavaKotlin - Better Java
Kotlin - Better Java
Dariusz Lorenc
 
Kotlin Bytecode Generation and Runtime Performance
Kotlin Bytecode Generation and Runtime PerformanceKotlin Bytecode Generation and Runtime Performance
Kotlin Bytecode Generation and Runtime Performance
intelliyole
 
Introduction to kotlin
Introduction to kotlinIntroduction to kotlin
Introduction to kotlin
NAVER Engineering
 
JVMLS 2016. Coroutines in Kotlin
JVMLS 2016. Coroutines in KotlinJVMLS 2016. Coroutines in Kotlin
JVMLS 2016. Coroutines in Kotlin
Andrey Breslav
 
Develop your next app with kotlin @ AndroidMakersFr 2017
Develop your next app with kotlin @ AndroidMakersFr 2017Develop your next app with kotlin @ AndroidMakersFr 2017
Develop your next app with kotlin @ AndroidMakersFr 2017
Arnaud Giuliani
 
BangaloreJUG introduction to kotlin
BangaloreJUG   introduction to kotlinBangaloreJUG   introduction to kotlin
BangaloreJUG introduction to kotlin
Chandra Sekhar Nayak
 
Kotlin Developer Starter in Android projects
Kotlin Developer Starter in Android projectsKotlin Developer Starter in Android projects
Kotlin Developer Starter in Android projects
Bartosz Kosarzycki
 
A quick and fast intro to Kotlin
A quick and fast intro to Kotlin A quick and fast intro to Kotlin
A quick and fast intro to Kotlin
XPeppers
 
Kotlin on android
Kotlin on androidKotlin on android
Kotlin on android
Kurt Renzo Acosta
 
Kotlin, smarter development for the jvm
Kotlin, smarter development for the jvmKotlin, smarter development for the jvm
Kotlin, smarter development for the jvm
Arnaud Giuliani
 
2017: Kotlin - now more than ever
2017: Kotlin - now more than ever2017: Kotlin - now more than ever
2017: Kotlin - now more than ever
Kai Koenig
 
Kotlin: a better Java
Kotlin: a better JavaKotlin: a better Java
Kotlin: a better Java
Nils Breunese
 
Lean way write asynchronous code with Kotlin’s coroutines - Ronen Sabag, Gett
Lean way write asynchronous code with Kotlin’s coroutines - Ronen Sabag, GettLean way write asynchronous code with Kotlin’s coroutines - Ronen Sabag, Gett
Lean way write asynchronous code with Kotlin’s coroutines - Ronen Sabag, Gett
DroidConTLV
 
Kotlin Overview
Kotlin OverviewKotlin Overview
Kotlin Overview
Silicon Straits
 

What's hot (20)

Kotlin as a Better Java
Kotlin as a Better JavaKotlin as a Better Java
Kotlin as a Better Java
 
Taking Kotlin to production, Seriously
Taking Kotlin to production, SeriouslyTaking Kotlin to production, Seriously
Taking Kotlin to production, Seriously
 
Kotlin boost yourproductivity
Kotlin boost yourproductivityKotlin boost yourproductivity
Kotlin boost yourproductivity
 
Swift and Kotlin Presentation
Swift and Kotlin PresentationSwift and Kotlin Presentation
Swift and Kotlin Presentation
 
Kotlin Slides from Devoxx 2011
Kotlin Slides from Devoxx 2011Kotlin Slides from Devoxx 2011
Kotlin Slides from Devoxx 2011
 
Kotlin: Challenges in JVM language design
Kotlin: Challenges in JVM language designKotlin: Challenges in JVM language design
Kotlin: Challenges in JVM language design
 
Kotlin - Better Java
Kotlin - Better JavaKotlin - Better Java
Kotlin - Better Java
 
Kotlin Bytecode Generation and Runtime Performance
Kotlin Bytecode Generation and Runtime PerformanceKotlin Bytecode Generation and Runtime Performance
Kotlin Bytecode Generation and Runtime Performance
 
Introduction to kotlin
Introduction to kotlinIntroduction to kotlin
Introduction to kotlin
 
JVMLS 2016. Coroutines in Kotlin
JVMLS 2016. Coroutines in KotlinJVMLS 2016. Coroutines in Kotlin
JVMLS 2016. Coroutines in Kotlin
 
Develop your next app with kotlin @ AndroidMakersFr 2017
Develop your next app with kotlin @ AndroidMakersFr 2017Develop your next app with kotlin @ AndroidMakersFr 2017
Develop your next app with kotlin @ AndroidMakersFr 2017
 
BangaloreJUG introduction to kotlin
BangaloreJUG   introduction to kotlinBangaloreJUG   introduction to kotlin
BangaloreJUG introduction to kotlin
 
Kotlin Developer Starter in Android projects
Kotlin Developer Starter in Android projectsKotlin Developer Starter in Android projects
Kotlin Developer Starter in Android projects
 
A quick and fast intro to Kotlin
A quick and fast intro to Kotlin A quick and fast intro to Kotlin
A quick and fast intro to Kotlin
 
Kotlin on android
Kotlin on androidKotlin on android
Kotlin on android
 
Kotlin, smarter development for the jvm
Kotlin, smarter development for the jvmKotlin, smarter development for the jvm
Kotlin, smarter development for the jvm
 
2017: Kotlin - now more than ever
2017: Kotlin - now more than ever2017: Kotlin - now more than ever
2017: Kotlin - now more than ever
 
Kotlin: a better Java
Kotlin: a better JavaKotlin: a better Java
Kotlin: a better Java
 
Lean way write asynchronous code with Kotlin’s coroutines - Ronen Sabag, Gett
Lean way write asynchronous code with Kotlin’s coroutines - Ronen Sabag, GettLean way write asynchronous code with Kotlin’s coroutines - Ronen Sabag, Gett
Lean way write asynchronous code with Kotlin’s coroutines - Ronen Sabag, Gett
 
Kotlin Overview
Kotlin OverviewKotlin Overview
Kotlin Overview
 

Similar to eMan Dev Meetup: Kotlin - A Language we should know it exists (part 02/03) 18.5.2017

Building Mobile Apps with Android
Building Mobile Apps with AndroidBuilding Mobile Apps with Android
Building Mobile Apps with Android
Kurt Renzo Acosta
 
Davide Cerbo - Kotlin: forse è la volta buona - Codemotion Milan 2017
Davide Cerbo - Kotlin: forse è la volta buona - Codemotion Milan 2017 Davide Cerbo - Kotlin: forse è la volta buona - Codemotion Milan 2017
Davide Cerbo - Kotlin: forse è la volta buona - Codemotion Milan 2017
Codemotion
 
Kotlin fundamentals - By: Ipan Ardian
Kotlin fundamentals - By: Ipan ArdianKotlin fundamentals - By: Ipan Ardian
Kotlin fundamentals - By: Ipan Ardian
Rizal Khilman
 
Kotlin Fundamentals
Kotlin Fundamentals Kotlin Fundamentals
Kotlin Fundamentals
Ipan Ardian
 
Reducing boilerplate with Kotlin, KTX and Kotlin Android Extensions
Reducing boilerplate with Kotlin, KTX and Kotlin Android ExtensionsReducing boilerplate with Kotlin, KTX and Kotlin Android Extensions
Reducing boilerplate with Kotlin, KTX and Kotlin Android Extensions
Patrick Steiger
 
Kotlin: maybe it's the right time
Kotlin: maybe it's the right timeKotlin: maybe it's the right time
Kotlin: maybe it's the right time
Davide Cerbo
 
Kotlin: A pragmatic language by JetBrains
Kotlin: A pragmatic language by JetBrainsKotlin: A pragmatic language by JetBrains
Kotlin: A pragmatic language by JetBrains
Jigar Gosar
 
Kotlin
KotlinKotlin
Kotlin cheat sheet by ekito
Kotlin cheat sheet by ekitoKotlin cheat sheet by ekito
Kotlin cheat sheet by ekito
Arnaud Giuliani
 
Exploring Koltin on Android
Exploring Koltin on AndroidExploring Koltin on Android
Exploring Koltin on Android
Deepanshu Madan
 
TMPA-2015: Kotlin: From Null Dereference to Smart Casts
TMPA-2015: Kotlin: From Null Dereference to Smart CastsTMPA-2015: Kotlin: From Null Dereference to Smart Casts
TMPA-2015: Kotlin: From Null Dereference to Smart Casts
Iosif Itkin
 
Android 101 - Kotlin ( Future of Android Development)
Android 101 - Kotlin ( Future of Android Development)Android 101 - Kotlin ( Future of Android Development)
Android 101 - Kotlin ( Future of Android Development)
Hassan Abid
 
The Swift Programming Language - Xcode6 for iOS App Development - AgileInfowa...
The Swift Programming Language - Xcode6 for iOS App Development - AgileInfowa...The Swift Programming Language - Xcode6 for iOS App Development - AgileInfowa...
The Swift Programming Language - Xcode6 for iOS App Development - AgileInfowa...
Mark Simon
 
Coding for Android on steroids with Kotlin
Coding for Android on steroids with KotlinCoding for Android on steroids with Kotlin
Coding for Android on steroids with Kotlin
Kai Koenig
 
Poniendo Kotlin en producción a palos (Kotlin in production, the hard way)
Poniendo Kotlin en producción a palos (Kotlin in production, the hard way)Poniendo Kotlin en producción a palos (Kotlin in production, the hard way)
Poniendo Kotlin en producción a palos (Kotlin in production, the hard way)
Andrés Viedma Peláez
 
Kotlin Introduction with Android applications
Kotlin Introduction with Android applicationsKotlin Introduction with Android applications
Kotlin Introduction with Android applications
Thao Huynh Quang
 
Introduction to kotlin and OOP in Kotlin
Introduction to kotlin and OOP in KotlinIntroduction to kotlin and OOP in Kotlin
Introduction to kotlin and OOP in Kotlin
vriddhigupta
 
Basics of kotlin ASJ
Basics of kotlin ASJBasics of kotlin ASJ
Basics of kotlin ASJ
DSCBVRITH
 
Elasticsearch's aggregations &amp; esctl in action or how i built a cli tool...
Elasticsearch's aggregations &amp; esctl in action  or how i built a cli tool...Elasticsearch's aggregations &amp; esctl in action  or how i built a cli tool...
Elasticsearch's aggregations &amp; esctl in action or how i built a cli tool...
FaithWestdorp
 
Боремся с NPE вместе с Kotlin, Павел Шацких СберТех
Боремся с NPE вместе с Kotlin, Павел Шацких СберТехБоремся с NPE вместе с Kotlin, Павел Шацких СберТех
Боремся с NPE вместе с Kotlin, Павел Шацких СберТех
Сбертех | SberTech
 

Similar to eMan Dev Meetup: Kotlin - A Language we should know it exists (part 02/03) 18.5.2017 (20)

Building Mobile Apps with Android
Building Mobile Apps with AndroidBuilding Mobile Apps with Android
Building Mobile Apps with Android
 
Davide Cerbo - Kotlin: forse è la volta buona - Codemotion Milan 2017
Davide Cerbo - Kotlin: forse è la volta buona - Codemotion Milan 2017 Davide Cerbo - Kotlin: forse è la volta buona - Codemotion Milan 2017
Davide Cerbo - Kotlin: forse è la volta buona - Codemotion Milan 2017
 
Kotlin fundamentals - By: Ipan Ardian
Kotlin fundamentals - By: Ipan ArdianKotlin fundamentals - By: Ipan Ardian
Kotlin fundamentals - By: Ipan Ardian
 
Kotlin Fundamentals
Kotlin Fundamentals Kotlin Fundamentals
Kotlin Fundamentals
 
Reducing boilerplate with Kotlin, KTX and Kotlin Android Extensions
Reducing boilerplate with Kotlin, KTX and Kotlin Android ExtensionsReducing boilerplate with Kotlin, KTX and Kotlin Android Extensions
Reducing boilerplate with Kotlin, KTX and Kotlin Android Extensions
 
Kotlin: maybe it's the right time
Kotlin: maybe it's the right timeKotlin: maybe it's the right time
Kotlin: maybe it's the right time
 
Kotlin: A pragmatic language by JetBrains
Kotlin: A pragmatic language by JetBrainsKotlin: A pragmatic language by JetBrains
Kotlin: A pragmatic language by JetBrains
 
Kotlin
KotlinKotlin
Kotlin
 
Kotlin cheat sheet by ekito
Kotlin cheat sheet by ekitoKotlin cheat sheet by ekito
Kotlin cheat sheet by ekito
 
Exploring Koltin on Android
Exploring Koltin on AndroidExploring Koltin on Android
Exploring Koltin on Android
 
TMPA-2015: Kotlin: From Null Dereference to Smart Casts
TMPA-2015: Kotlin: From Null Dereference to Smart CastsTMPA-2015: Kotlin: From Null Dereference to Smart Casts
TMPA-2015: Kotlin: From Null Dereference to Smart Casts
 
Android 101 - Kotlin ( Future of Android Development)
Android 101 - Kotlin ( Future of Android Development)Android 101 - Kotlin ( Future of Android Development)
Android 101 - Kotlin ( Future of Android Development)
 
The Swift Programming Language - Xcode6 for iOS App Development - AgileInfowa...
The Swift Programming Language - Xcode6 for iOS App Development - AgileInfowa...The Swift Programming Language - Xcode6 for iOS App Development - AgileInfowa...
The Swift Programming Language - Xcode6 for iOS App Development - AgileInfowa...
 
Coding for Android on steroids with Kotlin
Coding for Android on steroids with KotlinCoding for Android on steroids with Kotlin
Coding for Android on steroids with Kotlin
 
Poniendo Kotlin en producción a palos (Kotlin in production, the hard way)
Poniendo Kotlin en producción a palos (Kotlin in production, the hard way)Poniendo Kotlin en producción a palos (Kotlin in production, the hard way)
Poniendo Kotlin en producción a palos (Kotlin in production, the hard way)
 
Kotlin Introduction with Android applications
Kotlin Introduction with Android applicationsKotlin Introduction with Android applications
Kotlin Introduction with Android applications
 
Introduction to kotlin and OOP in Kotlin
Introduction to kotlin and OOP in KotlinIntroduction to kotlin and OOP in Kotlin
Introduction to kotlin and OOP in Kotlin
 
Basics of kotlin ASJ
Basics of kotlin ASJBasics of kotlin ASJ
Basics of kotlin ASJ
 
Elasticsearch's aggregations &amp; esctl in action or how i built a cli tool...
Elasticsearch's aggregations &amp; esctl in action  or how i built a cli tool...Elasticsearch's aggregations &amp; esctl in action  or how i built a cli tool...
Elasticsearch's aggregations &amp; esctl in action or how i built a cli tool...
 
Боремся с NPE вместе с Kotlin, Павел Шацких СберТех
Боремся с NPE вместе с Kotlin, Павел Шацких СберТехБоремся с NPE вместе с Kotlin, Павел Шацких СберТех
Боремся с NPE вместе с Kotlin, Павел Шацких СберТех
 

More from eMan s.r.o.

eMan Company Profile (2017/06) 2
eMan Company Profile (2017/06) 2eMan Company Profile (2017/06) 2
eMan Company Profile (2017/06) 2
eMan s.r.o.
 
eMan Company Profile (2017/06)
eMan Company Profile (2017/06)eMan Company Profile (2017/06)
eMan Company Profile (2017/06)
eMan s.r.o.
 
eMan Dev Meetup: Postavte si chytrou domácnost (2.8.2016, Hradec Králové)
eMan Dev Meetup: Postavte si chytrou domácnost (2.8.2016, Hradec Králové)eMan Dev Meetup: Postavte si chytrou domácnost (2.8.2016, Hradec Králové)
eMan Dev Meetup: Postavte si chytrou domácnost (2.8.2016, Hradec Králové)
eMan s.r.o.
 
Cesta k dokonalému UX in-car aplikace
Cesta k dokonalému UX in-car aplikaceCesta k dokonalému UX in-car aplikace
Cesta k dokonalému UX in-car aplikace
eMan s.r.o.
 
Specifika vývoje aplikací pro internet věcí (Dmytro Trofymchuk)
Specifika vývoje aplikací pro internet věcí (Dmytro Trofymchuk)Specifika vývoje aplikací pro internet věcí (Dmytro Trofymchuk)
Specifika vývoje aplikací pro internet věcí (Dmytro Trofymchuk)
eMan s.r.o.
 
Xamarin and DevOps workshop by eMan and Microsoft (13.4.2016)
Xamarin and DevOps workshop by eMan and Microsoft (13.4.2016)Xamarin and DevOps workshop by eMan and Microsoft (13.4.2016)
Xamarin and DevOps workshop by eMan and Microsoft (13.4.2016)
eMan s.r.o.
 
Vojtěch Mádr: Xamarin od A až do Z
Vojtěch Mádr: Xamarin od A až do ZVojtěch Mádr: Xamarin od A až do Z
Vojtěch Mádr: Xamarin od A až do Z
eMan s.r.o.
 
Žhavé trendy v mobilním marketingu v roce 2015 (rozšířená verze prezentace z ...
Žhavé trendy v mobilním marketingu v roce 2015 (rozšířená verze prezentace z ...Žhavé trendy v mobilním marketingu v roce 2015 (rozšířená verze prezentace z ...
Žhavé trendy v mobilním marketingu v roce 2015 (rozšířená verze prezentace z ...
eMan s.r.o.
 
Jak vyvinout úspěšnou aplikaci pro Google Glass (Martin Pelant, eMan)
Jak vyvinout úspěšnou aplikaci pro Google Glass (Martin Pelant, eMan)Jak vyvinout úspěšnou aplikaci pro Google Glass (Martin Pelant, eMan)
Jak vyvinout úspěšnou aplikaci pro Google Glass (Martin Pelant, eMan)
eMan s.r.o.
 
Profil společnosti eMan
Profil společnosti eManProfil společnosti eMan
Profil společnosti eManeMan s.r.o.
 
Aplikace Pojišťovna - případová studie
Aplikace Pojišťovna - případová studieAplikace Pojišťovna - případová studie
Aplikace Pojišťovna - případová studie
eMan s.r.o.
 
Mobilní zařízení jako nový prodejní kanál
Mobilní zařízení jako nový prodejní kanálMobilní zařízení jako nový prodejní kanál
Mobilní zařízení jako nový prodejní kanál
eMan s.r.o.
 
Světový trh mobilních telefonů ve 3. čtvrtletí 2011
Světový trh mobilních telefonů ve 3. čtvrtletí 2011Světový trh mobilních telefonů ve 3. čtvrtletí 2011
Světový trh mobilních telefonů ve 3. čtvrtletí 2011eMan s.r.o.
 

More from eMan s.r.o. (13)

eMan Company Profile (2017/06) 2
eMan Company Profile (2017/06) 2eMan Company Profile (2017/06) 2
eMan Company Profile (2017/06) 2
 
eMan Company Profile (2017/06)
eMan Company Profile (2017/06)eMan Company Profile (2017/06)
eMan Company Profile (2017/06)
 
eMan Dev Meetup: Postavte si chytrou domácnost (2.8.2016, Hradec Králové)
eMan Dev Meetup: Postavte si chytrou domácnost (2.8.2016, Hradec Králové)eMan Dev Meetup: Postavte si chytrou domácnost (2.8.2016, Hradec Králové)
eMan Dev Meetup: Postavte si chytrou domácnost (2.8.2016, Hradec Králové)
 
Cesta k dokonalému UX in-car aplikace
Cesta k dokonalému UX in-car aplikaceCesta k dokonalému UX in-car aplikace
Cesta k dokonalému UX in-car aplikace
 
Specifika vývoje aplikací pro internet věcí (Dmytro Trofymchuk)
Specifika vývoje aplikací pro internet věcí (Dmytro Trofymchuk)Specifika vývoje aplikací pro internet věcí (Dmytro Trofymchuk)
Specifika vývoje aplikací pro internet věcí (Dmytro Trofymchuk)
 
Xamarin and DevOps workshop by eMan and Microsoft (13.4.2016)
Xamarin and DevOps workshop by eMan and Microsoft (13.4.2016)Xamarin and DevOps workshop by eMan and Microsoft (13.4.2016)
Xamarin and DevOps workshop by eMan and Microsoft (13.4.2016)
 
Vojtěch Mádr: Xamarin od A až do Z
Vojtěch Mádr: Xamarin od A až do ZVojtěch Mádr: Xamarin od A až do Z
Vojtěch Mádr: Xamarin od A až do Z
 
Žhavé trendy v mobilním marketingu v roce 2015 (rozšířená verze prezentace z ...
Žhavé trendy v mobilním marketingu v roce 2015 (rozšířená verze prezentace z ...Žhavé trendy v mobilním marketingu v roce 2015 (rozšířená verze prezentace z ...
Žhavé trendy v mobilním marketingu v roce 2015 (rozšířená verze prezentace z ...
 
Jak vyvinout úspěšnou aplikaci pro Google Glass (Martin Pelant, eMan)
Jak vyvinout úspěšnou aplikaci pro Google Glass (Martin Pelant, eMan)Jak vyvinout úspěšnou aplikaci pro Google Glass (Martin Pelant, eMan)
Jak vyvinout úspěšnou aplikaci pro Google Glass (Martin Pelant, eMan)
 
Profil společnosti eMan
Profil společnosti eManProfil společnosti eMan
Profil společnosti eMan
 
Aplikace Pojišťovna - případová studie
Aplikace Pojišťovna - případová studieAplikace Pojišťovna - případová studie
Aplikace Pojišťovna - případová studie
 
Mobilní zařízení jako nový prodejní kanál
Mobilní zařízení jako nový prodejní kanálMobilní zařízení jako nový prodejní kanál
Mobilní zařízení jako nový prodejní kanál
 
Světový trh mobilních telefonů ve 3. čtvrtletí 2011
Světový trh mobilních telefonů ve 3. čtvrtletí 2011Světový trh mobilních telefonů ve 3. čtvrtletí 2011
Světový trh mobilních telefonů ve 3. čtvrtletí 2011
 

Recently uploaded

Jude: Practical Exhortations_Jude 17-23.pptx
Jude: Practical Exhortations_Jude 17-23.pptxJude: Practical Exhortations_Jude 17-23.pptx
Jude: Practical Exhortations_Jude 17-23.pptx
Stephen Palm
 
Lesson 9 - Resisting Temptation Along the Way.pptx
Lesson 9 - Resisting Temptation Along the Way.pptxLesson 9 - Resisting Temptation Along the Way.pptx
Lesson 9 - Resisting Temptation Along the Way.pptx
Celso Napoleon
 
Jesus Heals a Paralyzed Man for Children
Jesus Heals a Paralyzed Man for ChildrenJesus Heals a Paralyzed Man for Children
Jesus Heals a Paralyzed Man for Children
NelTorrente
 
Tarot for Your Self A Workbook for Personal Transformation Second Edition (M...
Tarot for Your Self  A Workbook for Personal Transformation Second Edition (M...Tarot for Your Self  A Workbook for Personal Transformation Second Edition (M...
Tarot for Your Self A Workbook for Personal Transformation Second Edition (M...
Mark457009
 
Exploring the Mindfulness Understanding Its Benefits.pptx
Exploring the Mindfulness Understanding Its Benefits.pptxExploring the Mindfulness Understanding Its Benefits.pptx
Exploring the Mindfulness Understanding Its Benefits.pptx
MartaLoveguard
 
Deerfoot Church of Christ Bulletin 6 2 24
Deerfoot Church of Christ Bulletin 6 2 24Deerfoot Church of Christ Bulletin 6 2 24
Deerfoot Church of Christ Bulletin 6 2 24
deerfootcoc
 
St John's Parish Diary for June 2024.pdf
St John's Parish Diary for June 2024.pdfSt John's Parish Diary for June 2024.pdf
St John's Parish Diary for June 2024.pdf
Chris Lyne
 
What Should be the Christian View of Anime?
What Should be the Christian View of Anime?What Should be the Christian View of Anime?
What Should be the Christian View of Anime?
Joe Muraguri
 
Qualifications in psychology _Dr.Navis.pdf
Qualifications in psychology _Dr.Navis.pdfQualifications in psychology _Dr.Navis.pdf
Qualifications in psychology _Dr.Navis.pdf
Oavis Or
 
St. John's Parish Magazine - June 2024 ..
St. John's Parish Magazine - June 2024 ..St. John's Parish Magazine - June 2024 ..
St. John's Parish Magazine - June 2024 ..
Chris Lyne
 
English - The Book of Joshua the Son of Nun.pdf
English - The Book of Joshua the Son of Nun.pdfEnglish - The Book of Joshua the Son of Nun.pdf
English - The Book of Joshua the Son of Nun.pdf
Filipino Tracts and Literature Society Inc.
 
The PBHP DYC ~ Reflections on The Dhamma (English).pptx
The PBHP DYC ~ Reflections on The Dhamma (English).pptxThe PBHP DYC ~ Reflections on The Dhamma (English).pptx
The PBHP DYC ~ Reflections on The Dhamma (English).pptx
OH TEIK BIN
 
The Good News, newsletter for June 2024 is here
The Good News, newsletter for June 2024 is hereThe Good News, newsletter for June 2024 is here
The Good News, newsletter for June 2024 is here
NoHo FUMC
 
Kenneth Grant - Against the Light-Holmes Pub Grou Llc (1999).pdf
Kenneth Grant - Against the Light-Holmes Pub Grou Llc (1999).pdfKenneth Grant - Against the Light-Holmes Pub Grou Llc (1999).pdf
Kenneth Grant - Against the Light-Holmes Pub Grou Llc (1999).pdf
AlanBianch
 
Evangelization in the footsteps of Saint Vincent de Paul
Evangelization in the footsteps of Saint Vincent de PaulEvangelization in the footsteps of Saint Vincent de Paul
Evangelization in the footsteps of Saint Vincent de Paul
Famvin: the Worldwide Vincentian Family
 
The Chakra System in our body - A Portal to Interdimensional Consciousness.pptx
The Chakra System in our body - A Portal to Interdimensional Consciousness.pptxThe Chakra System in our body - A Portal to Interdimensional Consciousness.pptx
The Chakra System in our body - A Portal to Interdimensional Consciousness.pptx
Bharat Technology
 
HANUMAN STORIES: TIMELESS TEACHINGS FOR TODAY’S WORLD
HANUMAN STORIES: TIMELESS TEACHINGS FOR TODAY’S WORLDHANUMAN STORIES: TIMELESS TEACHINGS FOR TODAY’S WORLD
HANUMAN STORIES: TIMELESS TEACHINGS FOR TODAY’S WORLD
Learnyoga
 

Recently uploaded (17)

Jude: Practical Exhortations_Jude 17-23.pptx
Jude: Practical Exhortations_Jude 17-23.pptxJude: Practical Exhortations_Jude 17-23.pptx
Jude: Practical Exhortations_Jude 17-23.pptx
 
Lesson 9 - Resisting Temptation Along the Way.pptx
Lesson 9 - Resisting Temptation Along the Way.pptxLesson 9 - Resisting Temptation Along the Way.pptx
Lesson 9 - Resisting Temptation Along the Way.pptx
 
Jesus Heals a Paralyzed Man for Children
Jesus Heals a Paralyzed Man for ChildrenJesus Heals a Paralyzed Man for Children
Jesus Heals a Paralyzed Man for Children
 
Tarot for Your Self A Workbook for Personal Transformation Second Edition (M...
Tarot for Your Self  A Workbook for Personal Transformation Second Edition (M...Tarot for Your Self  A Workbook for Personal Transformation Second Edition (M...
Tarot for Your Self A Workbook for Personal Transformation Second Edition (M...
 
Exploring the Mindfulness Understanding Its Benefits.pptx
Exploring the Mindfulness Understanding Its Benefits.pptxExploring the Mindfulness Understanding Its Benefits.pptx
Exploring the Mindfulness Understanding Its Benefits.pptx
 
Deerfoot Church of Christ Bulletin 6 2 24
Deerfoot Church of Christ Bulletin 6 2 24Deerfoot Church of Christ Bulletin 6 2 24
Deerfoot Church of Christ Bulletin 6 2 24
 
St John's Parish Diary for June 2024.pdf
St John's Parish Diary for June 2024.pdfSt John's Parish Diary for June 2024.pdf
St John's Parish Diary for June 2024.pdf
 
What Should be the Christian View of Anime?
What Should be the Christian View of Anime?What Should be the Christian View of Anime?
What Should be the Christian View of Anime?
 
Qualifications in psychology _Dr.Navis.pdf
Qualifications in psychology _Dr.Navis.pdfQualifications in psychology _Dr.Navis.pdf
Qualifications in psychology _Dr.Navis.pdf
 
St. John's Parish Magazine - June 2024 ..
St. John's Parish Magazine - June 2024 ..St. John's Parish Magazine - June 2024 ..
St. John's Parish Magazine - June 2024 ..
 
English - The Book of Joshua the Son of Nun.pdf
English - The Book of Joshua the Son of Nun.pdfEnglish - The Book of Joshua the Son of Nun.pdf
English - The Book of Joshua the Son of Nun.pdf
 
The PBHP DYC ~ Reflections on The Dhamma (English).pptx
The PBHP DYC ~ Reflections on The Dhamma (English).pptxThe PBHP DYC ~ Reflections on The Dhamma (English).pptx
The PBHP DYC ~ Reflections on The Dhamma (English).pptx
 
The Good News, newsletter for June 2024 is here
The Good News, newsletter for June 2024 is hereThe Good News, newsletter for June 2024 is here
The Good News, newsletter for June 2024 is here
 
Kenneth Grant - Against the Light-Holmes Pub Grou Llc (1999).pdf
Kenneth Grant - Against the Light-Holmes Pub Grou Llc (1999).pdfKenneth Grant - Against the Light-Holmes Pub Grou Llc (1999).pdf
Kenneth Grant - Against the Light-Holmes Pub Grou Llc (1999).pdf
 
Evangelization in the footsteps of Saint Vincent de Paul
Evangelization in the footsteps of Saint Vincent de PaulEvangelization in the footsteps of Saint Vincent de Paul
Evangelization in the footsteps of Saint Vincent de Paul
 
The Chakra System in our body - A Portal to Interdimensional Consciousness.pptx
The Chakra System in our body - A Portal to Interdimensional Consciousness.pptxThe Chakra System in our body - A Portal to Interdimensional Consciousness.pptx
The Chakra System in our body - A Portal to Interdimensional Consciousness.pptx
 
HANUMAN STORIES: TIMELESS TEACHINGS FOR TODAY’S WORLD
HANUMAN STORIES: TIMELESS TEACHINGS FOR TODAY’S WORLDHANUMAN STORIES: TIMELESS TEACHINGS FOR TODAY’S WORLD
HANUMAN STORIES: TIMELESS TEACHINGS FOR TODAY’S WORLD
 

eMan Dev Meetup: Kotlin - A Language we should know it exists (part 02/03) 18.5.2017

  • 1. otlin A Language we should know it exists
  • 2. Kotlin Agenda: ● What is Kotlin ● 10 Features You will Love about Kotlin ● Gradle goes Kotlin
  • 6. What is Kotlin ● Statically typed programming language targeting JVM, JavaScript ● Started in 2010 by the JetBrains ● They needed a language: ○ Expressive, Toolable, Interoperable, Pragmatic ● 100% interoperable with Java ● KClasses are compiled to Java bytecode (Java 6+)
  • 8. What is Kotlin “Kotlin is not business model for JetBrains, it is a tool to create business tools in more efficient language”
  • 9. What is Kotlin “Kotlin is designed to be an industrial-strength object-oriented language, and to be a better language than Java but still be fully interoperable with Java code, allowing companies to make a gradual migration from Java to Kotlin.” – Andrey Breslav, Development Lead for Kotlin
  • 11. What is Kotlin Who officially using Kotlin
  • 13. What is Kotlin Kotlin 1.0 ● February 15, 2016 (after 6 years) Kotlin 1.1 ● March 1, 2017 Kotlin 1.1.2 ● April 25, 2017
  • 14. What is Kotlin Kotlin on Android now (17.5.2017 Google I/O 17) official
  • 15. What is Kotlin / Demo public void updateWeather(int degrees) { String description; Color color; if (degrees < 5) { description = "cold"; color = Color.BLUE; } else if (degrees < 23) { description = "mild"; color = Color.ORANGE; } else { description = "hot"; color = Color.RED; } } You can do better with Kotlin by Svetlana Isakova
  • 16. What is Kotlin / Demo public void updateWeather(int degrees) { String description; Color color; if (degrees < 5) { description = "cold"; color = Color.BLUE; } else if (degrees < 23) { description = "mild"; color = Color.ORANGE; } else { description = "hot"; color = Color.RED; } } fun updateWeather(degrees: Int) { val description: String val color: Color if (degrees < 5) { description = "cold" color = Color.BLUE } else if (degrees < 23) { description = "mild" color = Color.ORANGE } else { description = "hot" color = Color.RED } }
  • 17. What is Kotlin / Demo public void updateWeather(int degrees) { String description; Color color; if (degrees < 5) { description = "cold"; color = Color.BLUE; } else if (degrees < 23) { description = "mild"; color = Color.ORANGE; } else { description = "hot"; color = Color.RED; } } fun updateWeather(degrees: Int) { val description: String val color: Color if (degrees < 5) { description = "cold" color = Color.BLUE } else if (degrees < 23) { description = "mild" color = Color.ORANGE } else { description = "hot" color = Color.RED } }
  • 18. What is Kotlin / Demo fun updateWeather(degrees: Int) { val description: String val color: Color if (degrees < 5) { description = "cold" color = Color.BLUE } else if (degrees < 23) { description = "mild" color = Color.ORANGE } else { description = "hot" color = Color.RED } } fun updateWeather(degrees: Int) { val (description: String, color: Color) = if (degrees < 5) { Pair("cold", Color.BLUE) } else if (degrees < 23) { Pair("mild", Color.ORANGE) } else { Pair("hot", Color.RED) } }
  • 19. What is Kotlin / Demo fun updateWeather(degrees: Int) { val (description: String, color: Color) = if (degrees < 5) { Pair("cold", Color.BLUE) } else if (degrees < 23) { Pair("mild", Color.ORANGE) } else { Pair("hot", Color.RED) } }
  • 20. What is Kotlin / Demo fun updateWeather(degrees: Int) { val (description, color) = if (degrees < 5) { Pair("cold", Color.BLUE) } else if (degrees < 23) { Pair("mild", Color.ORANGE) } else { Pair("hot", Color.RED) } }
  • 21. What is Kotlin / Demo fun updateWeather(degrees: Int) { val (description, color) = if (degrees < 5) { Pair("cold", Color.BLUE) } else if (degrees < 23) { Pair("mild", Color.ORANGE) } else { Pair("hot", Color.RED) } }
  • 22. What is Kotlin / Demo fun updateWeather(degrees: Int) { val (description, color) = when { degrees < 5 -> Pair("cold", Color.BLUE) degrees < 23 -> Pair("mild", Color.ORANGE) else -> Pair("hot", Color.RED) } }
  • 23. What is Kotlin / Demo fun updateWeather(degrees: Int) { val (description, color) = when { degrees < 5 -> Pair("cold", Color.BLUE) degrees < 23 -> Pair("mild", Color.ORANGE) else -> Pair("hot", Color.RED) } }
  • 24. What is Kotlin / Demo fun updateWeather(degrees: Int) { val (description, color) = when { degrees < 5 -> "cold" to Color.BLUE degrees < 23 -> "mild" to Color.ORANGE else -> "hot" to Color.RED } }
  • 25. What is Kotlin / Demo fun updateWeather(degrees: Int) { val (description, color) = when { degrees < 5 -> "cold" to Color.BLUE degrees < 23 -> "mild" to Color.ORANGE else -> "hot" to Color.RED } } public void updateWeather(int degrees) { String description; Color color; if (degrees < 5) { description = "cold"; color = Color.BLUE; } else if (degrees < 23) { description = "mild"; color = Color.ORANGE; } else { description = "hot"; color = Color.RED; } }
  • 26. 10 Features You will Love about Kotlin
  • 27. 1. Null Safety / 10 Features var a: String = "abc" a = null // compilation error var b: String? = "abc" b = null // ok val x: String? = "Hi" x.length // Does not compile. val y: String = null // Does not compile.
  • 28. 1. Null Safety / 10 Features var a: String = "abc" a = null // compilation error var b: String? = "abc" b = null // ok val x: String? = "Hi" x.length // Does not compile. val y: String = null // Does not compile.
  • 29. 1. Null Safety / 10 Features var a: String = "abc" a = null // compilation error var b: String? = "abc" b = null // ok val x: String? = "Hi" x.length // Does not compile. val y: String = null // Does not compile.
  • 30. 1. Null Safety / 10 Features var a: String = "abc" a = null // compilation error var b: String? = "abc" b = null // ok val x: String? = "Hi" x.length // Does not compile. val y: String = null // Does not compile.
  • 31. 1. Null Safety / 10 Features var a: String = "abc" a = null // compilation error var b: String? = "abc" b = null // ok val x: String? = "Hi" x.length // Does not compile. val y: String = null // Does not compile.
  • 32. 1. Null Safety / 10 Features var a: String = "abc" a = null // compilation error var b: String? = "abc" b = null // ok val x: String? = "Hi" x.length // Does not compile. val y: String = null // Does not compile.
  • 33. 1. Null Safety / 10 Features var a: String = "abc" a = null // compilation error var b: String? = "abc" b = null // ok val x: String? = "Hi" x.length // Does not compile. val y: String = null // Does not compile.
  • 34. 1. Null Safety / 10 Features if (x != null) { x.length // Compiles! Not idiomatic just to get length! } // Same as above (IntelliJ auto-suggested the change). x?.length // Elvis operator. val len = x?.length ?: -1 val len = x!!.length // Will throw if null. Rarely used
  • 35. 1. Null Safety / 10 Features if (x != null) { x.length // Compiles! Not idiomatic just to get length! } // Same as above (IntelliJ auto-suggested the change). x?.length // Elvis operator. val len = x?.length ?: -1 val len = x!!.length // Will throw if null. Rarely used
  • 36. 1. Null Safety / 10 Features if (x != null) { x.length // Compiles! Not idiomatic just to get length! } // Same as above (IntelliJ auto-suggested the change). x?.length // Elvis operator. val len = x?.length ?: -1 val len = x!!.length // Will throw if null. Rarely used
  • 37. 1. Null Safety / 10 Features if (x != null) { x.length // Compiles! Not idiomatic just to get length! } // Same as above (IntelliJ auto-suggested the change). x?.length // Elvis operator. val len = x?.length ?: -1 val len = x!!.length // Will throw if null. Rarely used
  • 39. 2. Data Class / 10 Features ● For simple classes which mainly hold data, we can avoid a lot of boilerplate compared to Java code
  • 40. 2. Data Class / 10 Features ● For simple classes which mainly hold data, we can avoid a lot of boilerplate compared to Java code ● Consider the following task: ○ Create Country object which holds data about id and name
  • 41. 2. Data Class / 10 Features
  • 42. 3. Data Class / 10 Features
  • 43. 3. Data Class / 10 Features ● Kotlin generate hashCode(), equals(), toString()
  • 44. 3. Data Class / 10 Features ● But that’s not all what we could with data classes! ○ We can easily make copies of data classes
  • 45. 3. Data Class / 10 Features ● But that’s not all what we could with data classes! ○ We can easily make copies of data classes val customer = Customer(id = 2001, name = "Vaclav Souhrada", email = "vsouhrada@email.to")
  • 46. 3. Data Class / 10 Features ● But that’s not all what we could with data classes! ○ We can easily make copies of data classes val customer = Customer(id = 2001, name = "Vaclav Souhrada", email = "vsouhrada@email.to") val updatedCst = customer.copy(email = "vaclav_souhrada@email.com")
  • 47. 3. Data Class / 10 Features
  • 49. 3. Extension Functions / 10 Features ● Kotlin allows us to extend the functionality of existing classes without inheriting from them. fun String.capitalize(): String { return this.toUpperCase() }
  • 50. 3. Extension Functions / 10 Features ● Kotlin allows us to extend the functionality of existing classes without inheriting from them. fun String.hello() { println("Hello, $this!") }
  • 51. 3. Extension Functions / 10 Features ● Kotlin allows us to extend the functionality of existing classes without inheriting from them. fun String.hello() { println("Hello, $this!") } fun String.and(input: String): String { return "${this} $input" }
  • 52. 3. Extension Functions / 10 Features ● Kotlin allows us to extend the functionality of existing classes without inheriting from them. fun main(args: Array<String>) { // prints VACLAV SOUHRADA println("vaclav souhrada".capitalize()) "Vaclav".hello() // prints 'Hello, Vaclav!' var testString = "This is a string".and("This is another") println(testString) // prints 'This is a string This is another' } fun String.hello() { println("Hello, $this!") } fun String.and(input: String): String { return "${this} $input" }
  • 53. 3. Extension Functions / 10 Features ● Kotlin allows us to extend the functionality of existing classes without inheriting from them. val gson = Gson()
  • 54. 3. Extension Functions / 10 Features ● Kotlin allows us to extend the functionality of existing classes without inheriting from them. val gson = Gson() fun Any.toJSON(): String { return gson.toJson(this) }
  • 55. 3. Extension Functions / 10 Features ● Kotlin allows us to extend the functionality of existing classes without inheriting from them. val gson = Gson() fun Any.toJSON(): String { return gson.toJson(this) } val customer = Customer(id = 2001, name = "Vaclav Souhrada", email = "vsouhrada@email.com")
  • 56. 3. Extension Functions / 10 Features ● Kotlin allows us to extend the functionality of existing classes without inheriting from them. val gson = Gson() fun Any.toJSON(): String { return gson.toJson(this) } val customer = Customer(id = 2001, name = "Vaclav Souhrada", email = "vsouhrada@email.com") val json = customer.toJSON()
  • 58. 4. Smart Cast / 10 Features if (obj instanceof String) { }
  • 59. 4. Smart Cast / 10 Features if (obj instanceof String) { System.out.println(((String) obj).length()); }
  • 60. 4. Smart Cast / 10 Features if (obj instanceof String) { System.out.println(((String) obj).length()); } if (obj is String) { }
  • 61. 4. Smart Cast / 10 Features if (obj instanceof String) { System.out.println(((String) obj).length()); } if (obj is String) { print(obj.length) }
  • 62. 4. Smart Cast / 10 Features if (obj instanceof String) { System.out.println(((String) obj).length()); } if (!(obj instanceof String)) { System.out.println("Not a String"); } if (obj is String) { print(obj.length) }
  • 63. 4. Smart Cast / 10 Features if (obj instanceof String) { System.out.println(((String) obj).length()); } if (!(obj instanceof String)) { System.out.println("Not a String"); } if (obj is String) { print(obj.length) } if (obj !is String) { // !(obj is String) print("Not a String") }
  • 64. 4. Smart Cast / 10 Features if (obj instanceof String) { System.out.println(((String) obj).length()); } if (!(obj instanceof String)) { System.out.println("Not a String"); } else { System.out.println(((String) obj).length()); } if (obj is String) { print(obj.length) } if (obj !is String) { // !(obj is String) print("Not a String") }
  • 65. 4. Smart Cast / 10 Features if (obj instanceof String) { System.out.println(((String) obj).length()); } if (!(obj instanceof String)) { System.out.println("Not a String"); } else { System.out.println(((String) obj).length()); } if (obj is String) { print(obj.length) } if (obj !is String) { // !(obj is String) print("Not a String") } else { print(obj.length) }
  • 66. 4. Smart Cast / 10 Features if (obj instanceof String) { System.out.println(((String) obj).length()); } if (!(obj instanceof String)) { System.out.println("Not a String"); } else { System.out.println(((String) obj).length()); } if (obj is String) { print(obj.length) } if (obj !is String) { // !(obj is String) print("Not a String") } else { print(obj.length) }
  • 67. 4. Smart Cast / 10 Features
  • 68. 4. Smart Cast / 10 Features
  • 69. 4. Smart Cast / 10 Features
  • 70. 4. Smart Cast / 10 Features
  • 72. 5. Singleton / 10 Features SingletonInJava.getInstance().doSomething() SingletonInKotlin.doSomething()
  • 74. 6. Functional Programming / 10 Features ● Combination of lambda expression and the Kotlin lib. makes our day easier when we working with collections val numbers = arrayListOf(10 ,5 , -9, 9, 11, 5, -6)
  • 75. 6. Functional Programming / 10 Features ● Combination of lambda expression and the Kotlin lib. makes our day easier when we working with collections val numbers = arrayListOf(10 ,5 , -9, 9, 11, 5, -6) val nonNegative = numbers.filter { it >= 0} println(nonNegative) // [10, 5, 9, 11, 5]
  • 76. 6. Functional Programming / 10 Features ● Combination of lambda expression and the Kotlin lib. makes our day easier when we working with collections val numbers = arrayListOf(10 ,5 , -9, 9, 11, 5, -6) val nonNegative = numbers.filter { it >= 0} println(nonNegative) // [10, 5, 9, 11, 5]
  • 77. 6. Functional Programming / 10 Features ● Combination of lambda expression and the Kotlin lib. makes our day easier when we working with collections val numbers = arrayListOf(10 ,5 , -9, 9, 11, 5, -6) // Sum of all elements: 25 println(numbers.foldRight(0, { a, b -> a + b }))
  • 78. 6. Functional Programming / 10 Features ● Combination of lambda expression and the Kotlin lib. makes our day easier when we working with collections val numbers = arrayListOf(10 ,5 , -9, 9, 11, 5, -6) // Sum of all elements: 25 println(numbers.foldRight(0, { a, b -> a + b })) //20 10 -18 18 22 10 -12 numbers.forEach { println("${it * 2} ") }
  • 79. 6. Functional Programming / 10 Features ● Combination of lambda expression and the Kotlin lib. makes our day easier when we working with collections val numbers = arrayListOf(10 ,5 , -9, 9, 11, 5, -6) // Sum of all elements: 25 println(numbers.foldRight(0, { a, b -> a + b })) //20 10 -18 18 22 10 -12 numbers.forEach { println("${it * 2} ") } val kindOfNumbers: Iterable<String> = numbers.filter { it < 0 } .map { "$it is negative" }
  • 80. 6. Functional Programming / 10 Features ● Combination of lambda expression and the Kotlin lib. makes our day easier when we working with collections val numbers = arrayListOf(10 ,5 , -9, 9, 11, 5, -6) // Sum of all elements: 25 println(numbers.foldRight(0, { a, b -> a + b })) //20 10 -18 18 22 10 -12 numbers.forEach { println("${it * 2} ") } val kindOfNumbers: Iterable<String> = numbers.filter { it < 0 } .map { "$it is negative" } println(kindOfNumbers) // [-9 is negative, -6 is negative]
  • 82. 7. Type Inference / 10 Features ● In Kotlin, you do not have to specify the type of each variable explicitly: val name = "Vaclav" // val name: String = "Vaclav"
  • 83. 7. Type Inference / 10 Features ● In Kotlin, you do not have to specify the type of each variable explicitly: val name = "Vaclav" val age = 31
  • 84. 7. Type Inference / 10 Features ● In Kotlin, you do not have to specify the type of each variable explicitly: val name = "Vaclav" val age = 31 // Only need Iterable interface val list: Iterable<Double> = arrayListOf(1.0, 0.0, 3.1415, 2.718)
  • 85. 7. Type Inference / 10 Features ● In Kotlin, you do not have to specify the type of each variable explicitly: val name = "Vaclav" val age = 31 // Only need Iterable interface val list: Iterable<Double> = arrayListOf(1.0, 0.0, 3.1415, 2.718) // Type is ArrayList val arrayList = arrayListOf("Kotlin", "Scala", "Groovy")
  • 87. 8. Default Arguments / 10 Features In Java, we often have to duplicate code in order define different variants of a method or constructor:
  • 88. 8. Default Arguments / 10 Features All this stuff we can remove when we switch to Kotlin by using default arguments. class OperatorInfoInKotlin( val uuid: String = UUID.randomUUID().toString(), val name: String, val hasAccess: Boolean = true, val isAdmin: Boolean = false, val notes: String = "") {}
  • 90. 9. Named Arguments / 10 Features Default arguments become more powerful in a combination with named arguments: OperatorInfoInKotlin(name = "Vaclav") OperatorInfoInKotlin(name = "Vaclav", hasAccess = false, isAdmin = false, notes = "blabla") new OperatorInfoInJava("Vaclav", false, false, "blabla");
  • 92. 10. Collections / 10 Features ● In Kotlin we have: ○ higher-order functions ○ lambda expressions ○ operator overloading ○ lazy evaluation ○ lots of others useful methods to work with the collection.
  • 93. 10. Collections / 10 Features “What is an average age of employees in the company in Pilsen city?” 1.6 !!!public double getAverageAge(@NotNull List<Employee> employees) { } int ageSum = 0; int count= 0; for (Employee employee : employees) { } if ("Pilsen".equals(employee.getCity()) { } ageSum += employee.getAge(); count++; if (count == 0) return 0 return ageSum / count;
  • 94. 10. Collections / 10 Features “What is an average age of employees in the company in Pilsen city?” fun getAverageAge(val employees: List<Employee>): Double { } .map{ it.age }employees.filter{ it.city == City.PILSEN } .average()return
  • 95. 10. Collections / 10 Features “What is an average age of employees in the company in Pilsen city?” public double getAverageAge(@NotNull List<Employee> employees) { int ageSum = 0; int count= 0; for (Employee employee : employees) { if ("Pilsen".equals(employee.getCity()) { ageSum += employee.getAge(); count++; } } if (count == 0) return 0 return ageSum / count; } fun getAverageAge(val employees: List<Employee>): Double { return employees.filter{ it.city == City.PILSEN }.map{ it.age }.average() }
  • 96. 10. Collections / 10 Features For more info you can see a very nice blog post from Antonio Leiva https://antonioleiva.com/collection-operations-kotlin/
  • 98. Bonus
  • 99. Bonus
  • 100. Bonus
  • 101. Bonus
  • 102. Bonus
  • 103. Bonus
  • 105. Gradle goes Kotlin ● Gradle is an advanced build management system based on Groovy ● Gradle is build tool with a focus on build automation for multi-language development ● Official build tool for Android!
  • 106. Gradle goes Kotlin ● Kotlin Meets Gradle (May 18, 2016) ○ Gradle and JetBrains announced a partnership to make Kotlin a first class language for Gradle builds! ■ auto-completion and content assist ■ quick documentation ■ navigation to source ■ refactoring and more
  • 108. Gradle goes Kotlin import org.gradle.api.plugins.* import org.gradle.api.tasks.wrapper.* import org.gradle.script.lang.kotlin.* group = "gradle-meets-kotlin" version = "1.0.0-SNAPSHOT" val kotlinVersion by extra.properties apply { plugin("application") } configure<ApplicationPluginConvention> { mainClassName = "samples.HelloWorld" applicationName = "gradle-meets-kotlin" } repositories { jcenter() mavenCentral() } dependencies { "testCompile"("junit:junit:4.12") }
  • 109.
  • 110. Thank you for your attention! eman.cz