SlideShare a Scribd company logo
Kotlin
L → ∞
@
@selassiabdellah ngMorocco
Kotlin L → ∞
What is Kotlin ?
An open source JVM targeted
language for JVM, Android & JS
Why JetBrains do create Kotlin?
IDEs for every language
Language that cut down the codebase
Concise language
Get ride for language issue NPE,..
Kotlin L → ∞
Why JetBrains do create Kotlin?
IDEs for every language
Language that cut down the codebase
Concise language
Get ride for language issues NPE,..
The Kotlin Language
Single line function.
Everything is expression in K
Mark return from labels
Lambda compile down to Anonymous
class
The Kotlin Language
Auto cast/smart cast
By default vars/types can’t have a null
value
Elvis operator
The less side effect you have the more
correct your program is (immutability)
- Hadi Hariri
JavaScript support
All language features in Kotlin 1.1
Reflection for JavaScript is not available
Dynamic types (dynamic types to
interoperate with “native” JavaScript
code)
JavaScript support
Node.js and the browser Support
npm The Kotlin Standard Library is
available for use through npm)
SINGLE LINE FUNCTION
fun double(x: Int): Int = x * 2
SINGLE LINE FUNCTION
fun double(x: Int) = x * 2
Kotlin By Example @lastIndex
length - 1
lastIndex
Kotlin By Example @Nullable
/**
* Consumes the next line of text and returns it.
* Returns null if there are no more lines.
*/
function readUtf8Line() throw "Exception"
/**
* Consumes the next line of text and returns it.
* Returns null if there are no more lines.
*/
fun readUtf8Line(): String?
Kotlin By Example @Nothing
fun fail() {
throw RuntimeException("Something went wrong")
}
fun fail(): Nothing {
throw RuntimeException("Something went wrong")
}
Kotlin By Example @when
if (firstName.equals("Dad")) {
person.setTeam(programmers);
} else if (lastName.equals("Dihiansan")) {
person.setTeam(designers);
} else {
person.setTeam(others);
}
when {
firstName == "Dan" -> person.team = programmers
lastName == "Dihiansan" -> person.team = designers
else -> person.team = others
}
Kotlin By Example @when
switch (firstName) {
case "Dan": person.setTeam(programmers)
break;
case "Jay": person.setTeam(programmers)
break;
case "Jamie": person.setTeam(designers)
break;
default:
person.setTeam(others)
}
when (firstName) {
"Dan", "Jay" -> person.team = programmers
"Jamie" -> person.team = designers
else -> person.team = others
}
Kotlin By Example @let
if (message != null) {
System.out.println(message)
}
message?.let { println(it) }
Kotlin By Example @?:
if (people == null) {
people = new ArrayList();
}
return people ?: emptyArrayList()
if (people == null) {
people = new ArrayList();
}
return people ?: emptyArrayList()
Just an ε demo
Where do I begin ?
Kotlin.link — almost a complete list of links to
Kotlin projects, libraries and other resources
Kotlin Weekly — a weekly mailing list containing
latest notable news and articles
The Daily Kotlin — Daily Kotlin news and tips
QUESTIONS?
@selassiabdellah

More Related Content

PDF
Kotlin for Android Development
PDF
Continuations in scala (incomplete version)
PPSX
Kotlin Language powerpoint show file
PPTX
Android with kotlin course
PPTX
Coding in kotlin
PPTX
Intro to kotlin
PDF
Kotlin from-scratch
Kotlin for Android Development
Continuations in scala (incomplete version)
Kotlin Language powerpoint show file
Android with kotlin course
Coding in kotlin
Intro to kotlin
Kotlin from-scratch

What's hot (20)

PPTX
Kotlin presentation
PDF
Xtext Webinar
PDF
Introduction to Kotlin for Java developer
PPTX
Modern Programming Languages - An overview
PDF
Scala the-good-parts
PDF
Having Fun with Kotlin Android - DILo Surabaya
PDF
Functional programming with Xtend
PDF
Introduction to Kotlin JVM language
PDF
Introduction to Kotlin coroutines
KEY
Messages from Perl
PPTX
Kotlin for android
PDF
Kotlin & Arrow the functional way
KEY
Remix Your Language Tooling (JSConf.eu 2012)
PDF
Kotlin & arrow: the functional way
PDF
Introduction to kotlin for Java Developer
PDF
Xtend - better java with -less- noise
PDF
FregeFX - JavaFX with Frege, a Haskell for the JVM
PDF
Grooming with Groovy
PDF
Functions, anonymous functions and the function type
Kotlin presentation
Xtext Webinar
Introduction to Kotlin for Java developer
Modern Programming Languages - An overview
Scala the-good-parts
Having Fun with Kotlin Android - DILo Surabaya
Functional programming with Xtend
Introduction to Kotlin JVM language
Introduction to Kotlin coroutines
Messages from Perl
Kotlin for android
Kotlin & Arrow the functional way
Remix Your Language Tooling (JSConf.eu 2012)
Kotlin & arrow: the functional way
Introduction to kotlin for Java Developer
Xtend - better java with -less- noise
FregeFX - JavaFX with Frege, a Haskell for the JVM
Grooming with Groovy
Functions, anonymous functions and the function type
Ad

Similar to Kotlin L → ∞ (20)

PPTX
Introduction to Kotlin for Android developers
PDF
Little Helpers for Android Development with Kotlin
PDF
Kotlin: A pragmatic language by JetBrains
PPTX
Introduction to Kotlin Language and its application to Android platform
PDF
A short introduction to the Kotlin language for Java developers
PDF
Kotlin, smarter development for the jvm
PDF
9054799 dzone-refcard267-kotlin
PPTX
PDF
Privet Kotlin (Windy City DevFest)
PDF
Let's Try Kotlin
PDF
Exploring Kotlin
PDF
JDD 2017: Kotlin for Java developers (Tomasz Kleszczyński)
PPTX
Kotlin - A Programming Language
PDF
What’s new in Kotlin?
PPTX
Intro to kotlin 2018
PDF
Kotlin- Basic to Advance
PDF
kotlin.pdf
PDF
A quick and fast intro to Kotlin
PDF
Kotlin what_you_need_to_know-converted event 4 with nigerians
PDF
Intro to Kotlin
Introduction to Kotlin for Android developers
Little Helpers for Android Development with Kotlin
Kotlin: A pragmatic language by JetBrains
Introduction to Kotlin Language and its application to Android platform
A short introduction to the Kotlin language for Java developers
Kotlin, smarter development for the jvm
9054799 dzone-refcard267-kotlin
Privet Kotlin (Windy City DevFest)
Let's Try Kotlin
Exploring Kotlin
JDD 2017: Kotlin for Java developers (Tomasz Kleszczyński)
Kotlin - A Programming Language
What’s new in Kotlin?
Intro to kotlin 2018
Kotlin- Basic to Advance
kotlin.pdf
A quick and fast intro to Kotlin
Kotlin what_you_need_to_know-converted event 4 with nigerians
Intro to Kotlin
Ad

Recently uploaded (20)

PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
AI in Product Development-omnex systems
PDF
medical staffing services at VALiNTRY
PPTX
history of c programming in notes for students .pptx
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
System and Network Administration Chapter 2
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PDF
System and Network Administraation Chapter 3
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PPTX
Reimagine Home Health with the Power of Agentic AI​
wealthsignaloriginal-com-DS-text-... (1).pdf
Softaken Excel to vCard Converter Software.pdf
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Design an Analysis of Algorithms I-SECS-1021-03
Internet Downloader Manager (IDM) Crack 6.42 Build 41
AI in Product Development-omnex systems
medical staffing services at VALiNTRY
history of c programming in notes for students .pptx
PTS Company Brochure 2025 (1).pdf.......
Navsoft: AI-Powered Business Solutions & Custom Software Development
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
CHAPTER 2 - PM Management and IT Context
System and Network Administration Chapter 2
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
System and Network Administraation Chapter 3
VVF-Customer-Presentation2025-Ver1.9.pptx
Reimagine Home Health with the Power of Agentic AI​

Kotlin L → ∞

  • 3. What is Kotlin ? An open source JVM targeted language for JVM, Android & JS
  • 4. Why JetBrains do create Kotlin? IDEs for every language Language that cut down the codebase Concise language Get ride for language issue NPE,..
  • 6. Why JetBrains do create Kotlin? IDEs for every language Language that cut down the codebase Concise language Get ride for language issues NPE,..
  • 7. The Kotlin Language Single line function. Everything is expression in K Mark return from labels Lambda compile down to Anonymous class
  • 8. The Kotlin Language Auto cast/smart cast By default vars/types can’t have a null value Elvis operator
  • 9. The less side effect you have the more correct your program is (immutability) - Hadi Hariri
  • 10. JavaScript support All language features in Kotlin 1.1 Reflection for JavaScript is not available Dynamic types (dynamic types to interoperate with “native” JavaScript code)
  • 11. JavaScript support Node.js and the browser Support npm The Kotlin Standard Library is available for use through npm)
  • 12. SINGLE LINE FUNCTION fun double(x: Int): Int = x * 2
  • 13. SINGLE LINE FUNCTION fun double(x: Int) = x * 2
  • 14. Kotlin By Example @lastIndex length - 1 lastIndex
  • 15. Kotlin By Example @Nullable /** * Consumes the next line of text and returns it. * Returns null if there are no more lines. */ function readUtf8Line() throw "Exception" /** * Consumes the next line of text and returns it. * Returns null if there are no more lines. */ fun readUtf8Line(): String?
  • 16. Kotlin By Example @Nothing fun fail() { throw RuntimeException("Something went wrong") } fun fail(): Nothing { throw RuntimeException("Something went wrong") }
  • 17. Kotlin By Example @when if (firstName.equals("Dad")) { person.setTeam(programmers); } else if (lastName.equals("Dihiansan")) { person.setTeam(designers); } else { person.setTeam(others); } when { firstName == "Dan" -> person.team = programmers lastName == "Dihiansan" -> person.team = designers else -> person.team = others }
  • 18. Kotlin By Example @when switch (firstName) { case "Dan": person.setTeam(programmers) break; case "Jay": person.setTeam(programmers) break; case "Jamie": person.setTeam(designers) break; default: person.setTeam(others) } when (firstName) { "Dan", "Jay" -> person.team = programmers "Jamie" -> person.team = designers else -> person.team = others }
  • 19. Kotlin By Example @let if (message != null) { System.out.println(message) } message?.let { println(it) }
  • 20. Kotlin By Example @?: if (people == null) { people = new ArrayList(); } return people ?: emptyArrayList()
  • 21. if (people == null) { people = new ArrayList(); } return people ?: emptyArrayList()
  • 22. Just an ε demo
  • 23. Where do I begin ? Kotlin.link — almost a complete list of links to Kotlin projects, libraries and other resources Kotlin Weekly — a weekly mailing list containing latest notable news and articles The Daily Kotlin — Daily Kotlin news and tips

Editor's Notes

  • #2: Bonjour Tous le monde A prime abord je me présente je suis Abdellah SELASSI Expert Android et développeur full stack mobile. Aujourd’hui vous allez voir le magnifique langage Kotlin développé par JetBrains et qui le langage le plus préféré dans la communauté Android ainsi qu’il est officiellement reconnu par google
  • #3: Voici quelque société qui utilise Kotlin
  • #4: C’est quoi Kotlin ? C'est un nouveau langage de programmation ciblant la plate-forme Java et JavaScript. Kotlin est un langage dont le typage est statique qui vise la lisibilité du coup il est concise, pragmatique ainsi qu’il le langage a introduit un nouveau concept et qui est parmis c’est point fort : qui est l'interopérabilité avec Java et JavaScript. Il peut être utilisé presque partout où Java & JavaScript est utilisé aujourd'hui: pour le développement côté serveur, côté client, développement Android, et bien plus encore. Kotlin fonctionne très bien avec toutes les librairies et frameworks Java et JavaScript existants. Kotlin vient de l'industrie, pas du milieu académique. Ce qui dit qu’il résout les problèmes rencontrés aujourd’hui par les programmeurs. --- Statically typed programming language for the JVM, Android and the browser Target platforms : server-side, Android, JS, anywhere Java runs
  • #5: Les utilisateurs de Kotlin obtiennent encore plus: la sécurité nulle imposée par le compilateur L'approche des langues modernes, y compris Kotlin, consiste à convertir (NullPointerException) des erreurs d'exécution en erreurs de compilation. Via le support de la nullabilité dans les types du système, le compilateur peut détecter de nombreuses erreurs possibles pendant la compilation et réduire la possibilité d'avoir des exceptions lancées au moment de l'exécution ---- Kotlin users get even more: compiler-enforced null safety The approach of modern languages, including Kotlin, is to convert these problems (NPE) from runtime errors into compile-time errors. By supporting nullability as part of the type system, the compiler can detect many possible errors during compilation and reduce the possibility of having exceptions thrown at runtime
  • #7: Les utilisateurs de Kotlin obtiennent encore plus: la sécurité nulle imposée par le compilateur L'approche des langues modernes, y compris Kotlin, consiste à convertir (NullPointerException) des erreurs d'exécution en erreurs de compilation. Via le support de la nullabilité dans les types du système, le compilateur peut détecter de nombreuses erreurs possibles pendant la compilation et réduire la possibilité d'avoir des exceptions lancées au moment de l'exécution ---- Kotlin users get even more: compiler-enforced null safety The approach of modern languages, including Kotlin, is to convert these problems (NPE) from runtime errors into compile-time errors. By supporting nullability as part of the type system, the compiler can detect many possible errors during compilation and reduce the possibility of having exceptions thrown at runtime
  • #8: Single line function (function with no body) -> equal’s some value -> type inference -> ignore type return Everything is expression in K -> return expression directly Mark return from labels -> useful with lambda Lambda compile down to Anonymous class (AC) -> AC has ref to it’s parent (K handle this think like Java 8)
  • #13: Single line function (function with no body) -> equal’s some value -> type inference -> ignore type return Lorsqu'une fonction renvoie une seule expression, les accolades peuvent être omises et le corps de la fonction deviendra après le symbole = When a function returns a single expression, the curly braces can be omitted and the body is specified after a = symbol
  • #14: La déclaration explicite du type de retour est facultative lorsque cela peut être déduit par le compilateur -- Explicitly declaring the return type is optional when this can be inferred by the compiler
  • #17: The Nothing type : This function never returns
  • #20: ... // execute this block if not null