SlideShare a Scribd company logo
Why Kotlin?
Yongqiang Li
Main Facts
• Statically typed programming language.
• Concise syntax which drastically reduces the amount of boilerplate code.
• OO + Functional programming
• Was born at JetBrains in 2010Open source, Free and under the Apache 2.0 license
• Releases
• 1.0 was released at Feb 2016
• 1.1 was released at Mar 2017
• Kotlin was officially supported by Google for Android as a “first-class” language.
(Announced in Google I/O 2017)
How it works with JVM?
JVM
JVM Bytecode
(.class)
.java
javac
.kt
kotlinc
Kotlin in Production
Simplify the Development
• Type can be inferred by compiler
• data class
• Function parameter default value, named parameters
• Properties
• Null safety!!!
• Smart casting
• High-order function and lambda
• …
Type can be inferred by compiler
Java
Kotlin
Data class (1)
Java
Total: 49 lines (followed the basic coding
convention, but removed the lines among
functions.)
Implemented class “Student”, which has “id”,
“name” and “age”.
Implemented all getters and setters
Implemented equals(), hashCode() and
toString()
Error-prone when the fields are removed or
added.
Data class (2)
Kotlin
Total: 1 lines. Compiler will do the same thing as
the Java version.
Actually, Kotlin compiler does more.
Function parameter default value, named
parameters (1)
Only Kotlin
supports it
Function parameter default value, named
parameters (2)
In Java, you have to use function
overloading.
No named parameter workaround.
Properties
Smart casting
Kotlin
Java
Null Safety!!!
Only Kotlin supports it
Nonnull type is different from nullable type
Null can be assigned to a Nonnull type.
Compiler will guard it
High-order functions and Lambda
Only Kotlin supports it.
…
• More features/improvements
• Extensions
• Delegation
• Inline functions
• Ranges
• when expression
• Type aliases
• Coroutines
• …
Interoperability
• 100% compatibility with Java code in both directions
• No need to bundle additional runtime to the app
• In D4C GUI build testing, only need one additional jar file kotlin-osgi-bundle.jar
(3.2MB)
• Backward compatibility with previous versions (such as Java 1.6, 1.7)
• Easy convert Java code to Kotlin
Toolchain
• Maven
• Allow Java and Kotlin to be compiled together
• In testing, successfully built Kotlin into D4C GUI
• Eclipse Kotlin Plugin – developed and maintained by JetBrains, for free
• Intellij IDEA Kotlin – Community Edition is for free
• Ktlint – coding convention, basic rules
Support
• Developing by JetBrains
• Great tutorial, documentation on kotlinlang.org
• Google official support forAndroid
• Open Source
• Working with Community
• Frequent Updates
Conclusion
• Kotlin provides a lot of new features, which allow engineers to write concise,
safe code. Productivity will be improved a lot!
• Great interoperability with Java and Kotlin is a great compliment.
• Good toolchain.
• Great support from Jetbrains, Google and community.
References
• Kotlin OfficialWebsite
• Kotlin and Android

More Related Content

What's hot

Language Engineering in the Cloud
Language Engineering in the CloudLanguage Engineering in the Cloud
Language Engineering in the Cloudlennartkats
 
Architectural changes in Orion
Architectural changes in OrionArchitectural changes in Orion
Architectural changes in Orion
Tomas Dermisek
 
Coding in kotlin
Coding in kotlinCoding in kotlin
Coding in kotlin
Debmalya Jash
 
The Spoofax Language Workbench (SPLASH 2010)
The Spoofax Language Workbench (SPLASH 2010)The Spoofax Language Workbench (SPLASH 2010)
The Spoofax Language Workbench (SPLASH 2010)
lennartkats
 
A short introduction to the Kotlin language for Java developers
A short introduction to the Kotlin language for Java developersA short introduction to the Kotlin language for Java developers
A short introduction to the Kotlin language for Java developers
Antonis Lilis
 
Java introduction
Java introductionJava introduction
Java introduction
NAVEENA ESWARAN
 
SyPy IronPython
SyPy IronPythonSyPy IronPython
SyPy IronPython
Nick Hodge
 
Isomorphic Kotlin
Isomorphic KotlinIsomorphic Kotlin
Isomorphic Kotlin
Benjamin Snider
 
Kotlin
KotlinKotlin
Kotlin
Ravi Pawar
 
How to Supercharge your PHP Web API
How to Supercharge your PHP Web APIHow to Supercharge your PHP Web API
How to Supercharge your PHP Web API
Aurimas Niekis
 
Intro to Crystal Programming Language
Intro to Crystal Programming LanguageIntro to Crystal Programming Language
Intro to Crystal Programming Language
Adler Hsieh
 
Kotlin for Android Developer - Make our live easier
Kotlin for Android Developer - Make our live easierKotlin for Android Developer - Make our live easier
Kotlin for Android Developer - Make our live easier
Tai Dang
 
Clojure presentation
Clojure presentationClojure presentation
Clojure presentation
Karthik Raghunahtan
 
Java Presentation
Java PresentationJava Presentation
Java Presentation
SMNajrulHowlader
 
JIT Compiler
JIT CompilerJIT Compiler
Remix Your Language Tooling (JSConf.eu 2012)
Remix Your Language Tooling (JSConf.eu 2012)Remix Your Language Tooling (JSConf.eu 2012)
Remix Your Language Tooling (JSConf.eu 2012)
lennartkats
 
The Java Story
The Java StoryThe Java Story
The Java Story
David Parsons
 
.Net Introduction
.Net Introduction.Net Introduction
.Net Introduction
Muzzammil Wani
 
Not your fathers language c++
Not your fathers language c++Not your fathers language c++
Not your fathers language c++
명신 김
 

What's hot (20)

Language Engineering in the Cloud
Language Engineering in the CloudLanguage Engineering in the Cloud
Language Engineering in the Cloud
 
Architectural changes in Orion
Architectural changes in OrionArchitectural changes in Orion
Architectural changes in Orion
 
Coding in kotlin
Coding in kotlinCoding in kotlin
Coding in kotlin
 
The Spoofax Language Workbench (SPLASH 2010)
The Spoofax Language Workbench (SPLASH 2010)The Spoofax Language Workbench (SPLASH 2010)
The Spoofax Language Workbench (SPLASH 2010)
 
A short introduction to the Kotlin language for Java developers
A short introduction to the Kotlin language for Java developersA short introduction to the Kotlin language for Java developers
A short introduction to the Kotlin language for Java developers
 
Java introduction
Java introductionJava introduction
Java introduction
 
SyPy IronPython
SyPy IronPythonSyPy IronPython
SyPy IronPython
 
Isomorphic Kotlin
Isomorphic KotlinIsomorphic Kotlin
Isomorphic Kotlin
 
Kotlin
KotlinKotlin
Kotlin
 
How to Supercharge your PHP Web API
How to Supercharge your PHP Web APIHow to Supercharge your PHP Web API
How to Supercharge your PHP Web API
 
Intro to Crystal Programming Language
Intro to Crystal Programming LanguageIntro to Crystal Programming Language
Intro to Crystal Programming Language
 
Kotlin for Android Developer - Make our live easier
Kotlin for Android Developer - Make our live easierKotlin for Android Developer - Make our live easier
Kotlin for Android Developer - Make our live easier
 
History of java'
History of java'History of java'
History of java'
 
Clojure presentation
Clojure presentationClojure presentation
Clojure presentation
 
Java Presentation
Java PresentationJava Presentation
Java Presentation
 
JIT Compiler
JIT CompilerJIT Compiler
JIT Compiler
 
Remix Your Language Tooling (JSConf.eu 2012)
Remix Your Language Tooling (JSConf.eu 2012)Remix Your Language Tooling (JSConf.eu 2012)
Remix Your Language Tooling (JSConf.eu 2012)
 
The Java Story
The Java StoryThe Java Story
The Java Story
 
.Net Introduction
.Net Introduction.Net Introduction
.Net Introduction
 
Not your fathers language c++
Not your fathers language c++Not your fathers language c++
Not your fathers language c++
 

Similar to Why Kotlin?

Kotlin
KotlinKotlin
Future of Kotlin - How agile can language development be?
Future of Kotlin - How agile can language development be?Future of Kotlin - How agile can language development be?
Future of Kotlin - How agile can language development be?
Andrey Breslav
 
Kotlin for Android
Kotlin for AndroidKotlin for Android
Kotlin for Android
Han Yin
 
Introduction to Kotlin
Introduction to KotlinIntroduction to Kotlin
Introduction to Kotlin
T.M. Ishrak Hussain
 
Developers’ mDay u Banjoj Luci - Duško Bajić, Kotlin User Group Bosnia – Kotl...
Developers’ mDay u Banjoj Luci - Duško Bajić, Kotlin User Group Bosnia – Kotl...Developers’ mDay u Banjoj Luci - Duško Bajić, Kotlin User Group Bosnia – Kotl...
Developers’ mDay u Banjoj Luci - Duško Bajić, Kotlin User Group Bosnia – Kotl...
mCloud
 
Kotlin Multiplatfom In Action
Kotlin Multiplatfom In ActionKotlin Multiplatfom In Action
Kotlin Multiplatfom In Action
Marko Mitic
 
Kotlin Multiplatfom In Action
Kotlin Multiplatfom In ActionKotlin Multiplatfom In Action
Kotlin Multiplatfom In Action
Marko Mitic
 
Kotlin
KotlinKotlin
Kotlin tlv
Kotlin tlvKotlin tlv
Kotlin tlv
Boris Farber
 
ITB2024 - Keynote Day 1 - Ortus Solutions.pdf
ITB2024 - Keynote Day 1 - Ortus Solutions.pdfITB2024 - Keynote Day 1 - Ortus Solutions.pdf
ITB2024 - Keynote Day 1 - Ortus Solutions.pdf
Ortus Solutions, Corp
 
Kotlin Language powerpoint show file
Kotlin Language powerpoint show fileKotlin Language powerpoint show file
Kotlin Language powerpoint show file
Saurabh Tripathi
 
Kotlin Overview
Kotlin OverviewKotlin Overview
Kotlin Overview
Ekta Raj
 
Introduction to Kotlin - Android KTX
Introduction to Kotlin - Android KTXIntroduction to Kotlin - Android KTX
Introduction to Kotlin - Android KTX
Syed Awais Mazhar Bukhari
 
Introduction_to_Kotlin.pptx
Introduction_to_Kotlin.pptxIntroduction_to_Kotlin.pptx
Introduction_to_Kotlin.pptx
HARSHITJAIN068
 
Kotlin Online Training.pdf
Kotlin Online Training.pdfKotlin Online Training.pdf
Kotlin Online Training.pdf
SpiritsoftsTraining
 
Kotlin Online Training.pdf
Kotlin Online Training.pdfKotlin Online Training.pdf
Kotlin Online Training.pdf
SpiritsoftsTraining
 
Kotlin Online Training.pdf
Kotlin Online Training.pdfKotlin Online Training.pdf
Kotlin Online Training.pdf
SpiritsoftsTraining
 
Kotlin Online Training.pdf
Kotlin Online Training.pdfKotlin Online Training.pdf
Kotlin Online Training.pdf
SpiritsoftsTraining
 
Kotlin Online Training.pdf
Kotlin Online Training.pdfKotlin Online Training.pdf
Kotlin Online Training.pdf
SpiritsoftsTraining
 
Kotlin Online Training.pdf
Kotlin Online Training.pdfKotlin Online Training.pdf
Kotlin Online Training.pdf
SpiritsoftsTraining
 

Similar to Why Kotlin? (20)

Kotlin
KotlinKotlin
Kotlin
 
Future of Kotlin - How agile can language development be?
Future of Kotlin - How agile can language development be?Future of Kotlin - How agile can language development be?
Future of Kotlin - How agile can language development be?
 
Kotlin for Android
Kotlin for AndroidKotlin for Android
Kotlin for Android
 
Introduction to Kotlin
Introduction to KotlinIntroduction to Kotlin
Introduction to Kotlin
 
Developers’ mDay u Banjoj Luci - Duško Bajić, Kotlin User Group Bosnia – Kotl...
Developers’ mDay u Banjoj Luci - Duško Bajić, Kotlin User Group Bosnia – Kotl...Developers’ mDay u Banjoj Luci - Duško Bajić, Kotlin User Group Bosnia – Kotl...
Developers’ mDay u Banjoj Luci - Duško Bajić, Kotlin User Group Bosnia – Kotl...
 
Kotlin Multiplatfom In Action
Kotlin Multiplatfom In ActionKotlin Multiplatfom In Action
Kotlin Multiplatfom In Action
 
Kotlin Multiplatfom In Action
Kotlin Multiplatfom In ActionKotlin Multiplatfom In Action
Kotlin Multiplatfom In Action
 
Kotlin
KotlinKotlin
Kotlin
 
Kotlin tlv
Kotlin tlvKotlin tlv
Kotlin tlv
 
ITB2024 - Keynote Day 1 - Ortus Solutions.pdf
ITB2024 - Keynote Day 1 - Ortus Solutions.pdfITB2024 - Keynote Day 1 - Ortus Solutions.pdf
ITB2024 - Keynote Day 1 - Ortus Solutions.pdf
 
Kotlin Language powerpoint show file
Kotlin Language powerpoint show fileKotlin Language powerpoint show file
Kotlin Language powerpoint show file
 
Kotlin Overview
Kotlin OverviewKotlin Overview
Kotlin Overview
 
Introduction to Kotlin - Android KTX
Introduction to Kotlin - Android KTXIntroduction to Kotlin - Android KTX
Introduction to Kotlin - Android KTX
 
Introduction_to_Kotlin.pptx
Introduction_to_Kotlin.pptxIntroduction_to_Kotlin.pptx
Introduction_to_Kotlin.pptx
 
Kotlin Online Training.pdf
Kotlin Online Training.pdfKotlin Online Training.pdf
Kotlin Online Training.pdf
 
Kotlin Online Training.pdf
Kotlin Online Training.pdfKotlin Online Training.pdf
Kotlin Online Training.pdf
 
Kotlin Online Training.pdf
Kotlin Online Training.pdfKotlin Online Training.pdf
Kotlin Online Training.pdf
 
Kotlin Online Training.pdf
Kotlin Online Training.pdfKotlin Online Training.pdf
Kotlin Online Training.pdf
 
Kotlin Online Training.pdf
Kotlin Online Training.pdfKotlin Online Training.pdf
Kotlin Online Training.pdf
 
Kotlin Online Training.pdf
Kotlin Online Training.pdfKotlin Online Training.pdf
Kotlin Online Training.pdf
 

More from Yongqiang Li

How to Recognize Henry's Face
How to Recognize Henry's FaceHow to Recognize Henry's Face
How to Recognize Henry's Face
Yongqiang Li
 
Introduction to Boost regex
Introduction to Boost regexIntroduction to Boost regex
Introduction to Boost regex
Yongqiang Li
 
Let's talk about java class loader
Let's talk about java class loaderLet's talk about java class loader
Let's talk about java class loader
Yongqiang Li
 
Brief introduction to domain-driven design
Brief introduction to domain-driven designBrief introduction to domain-driven design
Brief introduction to domain-driven designYongqiang Li
 
Let's talk about java class file
Let's talk about java class fileLet's talk about java class file
Let's talk about java class file
Yongqiang Li
 
Eclipse GEF (Part I)
Eclipse GEF (Part I)Eclipse GEF (Part I)
Eclipse GEF (Part I)Yongqiang Li
 
Garbage Collection of Java VM
Garbage Collection of Java VMGarbage Collection of Java VM
Garbage Collection of Java VM
Yongqiang Li
 
Let's talk about jni
Let's talk about jniLet's talk about jni
Let's talk about jni
Yongqiang Li
 

More from Yongqiang Li (8)

How to Recognize Henry's Face
How to Recognize Henry's FaceHow to Recognize Henry's Face
How to Recognize Henry's Face
 
Introduction to Boost regex
Introduction to Boost regexIntroduction to Boost regex
Introduction to Boost regex
 
Let's talk about java class loader
Let's talk about java class loaderLet's talk about java class loader
Let's talk about java class loader
 
Brief introduction to domain-driven design
Brief introduction to domain-driven designBrief introduction to domain-driven design
Brief introduction to domain-driven design
 
Let's talk about java class file
Let's talk about java class fileLet's talk about java class file
Let's talk about java class file
 
Eclipse GEF (Part I)
Eclipse GEF (Part I)Eclipse GEF (Part I)
Eclipse GEF (Part I)
 
Garbage Collection of Java VM
Garbage Collection of Java VMGarbage Collection of Java VM
Garbage Collection of Java VM
 
Let's talk about jni
Let's talk about jniLet's talk about jni
Let's talk about jni
 

Recently uploaded

ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
CatarinaPereira64715
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 

Recently uploaded (20)

ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 

Why Kotlin?

  • 2. Main Facts • Statically typed programming language. • Concise syntax which drastically reduces the amount of boilerplate code. • OO + Functional programming • Was born at JetBrains in 2010Open source, Free and under the Apache 2.0 license • Releases • 1.0 was released at Feb 2016 • 1.1 was released at Mar 2017 • Kotlin was officially supported by Google for Android as a “first-class” language. (Announced in Google I/O 2017)
  • 3. How it works with JVM? JVM JVM Bytecode (.class) .java javac .kt kotlinc
  • 5. Simplify the Development • Type can be inferred by compiler • data class • Function parameter default value, named parameters • Properties • Null safety!!! • Smart casting • High-order function and lambda • …
  • 6. Type can be inferred by compiler Java Kotlin
  • 7. Data class (1) Java Total: 49 lines (followed the basic coding convention, but removed the lines among functions.) Implemented class “Student”, which has “id”, “name” and “age”. Implemented all getters and setters Implemented equals(), hashCode() and toString() Error-prone when the fields are removed or added.
  • 8. Data class (2) Kotlin Total: 1 lines. Compiler will do the same thing as the Java version. Actually, Kotlin compiler does more.
  • 9. Function parameter default value, named parameters (1) Only Kotlin supports it
  • 10. Function parameter default value, named parameters (2) In Java, you have to use function overloading. No named parameter workaround.
  • 13. Null Safety!!! Only Kotlin supports it Nonnull type is different from nullable type Null can be assigned to a Nonnull type. Compiler will guard it
  • 14. High-order functions and Lambda Only Kotlin supports it.
  • 15. … • More features/improvements • Extensions • Delegation • Inline functions • Ranges • when expression • Type aliases • Coroutines • …
  • 16. Interoperability • 100% compatibility with Java code in both directions • No need to bundle additional runtime to the app • In D4C GUI build testing, only need one additional jar file kotlin-osgi-bundle.jar (3.2MB) • Backward compatibility with previous versions (such as Java 1.6, 1.7) • Easy convert Java code to Kotlin
  • 17. Toolchain • Maven • Allow Java and Kotlin to be compiled together • In testing, successfully built Kotlin into D4C GUI • Eclipse Kotlin Plugin – developed and maintained by JetBrains, for free • Intellij IDEA Kotlin – Community Edition is for free • Ktlint – coding convention, basic rules
  • 18. Support • Developing by JetBrains • Great tutorial, documentation on kotlinlang.org • Google official support forAndroid • Open Source • Working with Community • Frequent Updates
  • 19. Conclusion • Kotlin provides a lot of new features, which allow engineers to write concise, safe code. Productivity will be improved a lot! • Great interoperability with Java and Kotlin is a great compliment. • Good toolchain. • Great support from Jetbrains, Google and community.