SlideShare a Scribd company logo
Coding in Kotlin
Debmalya Jash
Discussion Summary
• Kotlin
• What ?
• Why?
• Where?
• How?
About Kotlin
• New programming language that is a pragmatic, safe, concise, and interoperable alternative to
Java.
• With Kotlin, you can implement your projects with less code, a higher level of abstraction, and
fewer annoyances.
• Statically typed programming language (Not like other dynamically typed programming languages
Groovy, JRuby).
• [Note: However, in contrast to Java, Kotlin does not require you to specify the type of every
variable explicitly in your source code. In many cases, the type of a variable can automatically be
determined from context, and in those cases Kotlin allows you to omit the type. Here’s the simplest
possible example of this:
val x = 1]
Kotlin Sample Code
Sample Code Explanation
Explanation
• We declare a simple data class with two properties: name and age.
Age is null by default (if it isn’t specified). While creating a list of
persons, you omit Alice’s age, so the default value null is used. Then
you use the function maxBy to find the oldest person in a list. The
lambda expression passed to the function takes one parameter, and
we use "it" as the default name of that parameter. The "elvis"
operator ?: returns zero if the age is null. Because Alice’s age is not
specified, it is considered to be zero, so Bob wins the prize of being
the oldest one.
Why?
• The primary goal of Kotlin is to work as a more concise, more
productive and safer alternative to Java, suitable in all contexts where
Java is used today.
NullPointerException
• Do you cry out loud every time you see a Null Pointer Exception in
your bug tracker? Then Kotlin is your solution!
• Kotlin’s support for nullable types, which lets you write more reliable
programs by detecting possible null pointer exceptions at compile
time.
Where?
• Building server-side code (typically backends of Web applications).
• Building mobile applications that run on Android devices.
• But Kotlin works in other contexts as well. For example, you can use
RoboVM 1 to run Kotlin code on iOS devices. Or you can use Kotlin
together with JavaFX 2 to build desktop applications.
• In addition to Java, Kotlin also can be compiled to JavaScript, allowing
you to run Kotlin code in the browser.
Benefit of statically typed language
• Performance: Calling methods is faster because in most cases there is
no need to figure out at runtime which method needs to be called.
• Reliability: The compiler verifies the correctness of the program, so
there are fewer opportunities for crashes at runtime.
• Maintainability: Working with unfamiliar code is easier because you
can see what kind of objects the code is working with.
• Tool support: Static typing enables reliable refactorings, code
completion and other IDE features.
How?
Reference
• Kotlin In Action
• Kotlin Programming Language
• Kotlin Language Documentation
• Kotlin In Action Forum
• Kotlin GitHub
• https://github.com/JetBrains/Exposed
• https://github.com/jetbrains/anko
• Kotlin Tutorials
• Kotlin Playground

More Related Content

What's hot (20)

PPTX
Android with kotlin course
Abdul Rahman Masri Attal
 
PDF
Kotlin & Swift
zezzi Castillo
 
PDF
Introduction to Kotlin for Java developer
Shuhei Shogen
 
PPSX
Kotlin Language powerpoint show file
Saurabh Tripathi
 
PDF
Log cat kotlindsl
sanaebadi1
 
PPTX
Gdg dev fest 2107 to kotlin, with love
Ayman Mahfouz
 
PPTX
Why Kotlin?
Yongqiang Li
 
PPTX
Kotlin For Android (at DevFest İzmir 2016)
Semih Bozdemir
 
PDF
Extending js codemotion warsaw 2016
Francis Bourre
 
PDF
Extending JS WU2016 Toronto
Francis Bourre
 
PPTX
hexMachina WWX 2016
Francis Bourre
 
PDF
Kotlin Multiplatfom In Action
Marko Mitic
 
PDF
Lock-free algorithms for Kotlin Coroutines
Roman Elizarov
 
PPTX
Es build presentation
PT Citra Niaga Teknologi
 
PDF
The Spoofax Language Workbench (SPLASH 2010)
lennartkats
 
PPTX
Kotlin for android
Shady Selim
 
PPTX
Kotlin Multiplatfom In Action
Marko Mitic
 
KEY
Using Aspects for Language Portability (SCAM 2010)
lennartkats
 
PPT
CSP: Huh? And Components
Daniel Fagnan
 
PPTX
Kotlin L → ∞
Abdellah SELASSI
 
Android with kotlin course
Abdul Rahman Masri Attal
 
Kotlin & Swift
zezzi Castillo
 
Introduction to Kotlin for Java developer
Shuhei Shogen
 
Kotlin Language powerpoint show file
Saurabh Tripathi
 
Log cat kotlindsl
sanaebadi1
 
Gdg dev fest 2107 to kotlin, with love
Ayman Mahfouz
 
Why Kotlin?
Yongqiang Li
 
Kotlin For Android (at DevFest İzmir 2016)
Semih Bozdemir
 
Extending js codemotion warsaw 2016
Francis Bourre
 
Extending JS WU2016 Toronto
Francis Bourre
 
hexMachina WWX 2016
Francis Bourre
 
Kotlin Multiplatfom In Action
Marko Mitic
 
Lock-free algorithms for Kotlin Coroutines
Roman Elizarov
 
Es build presentation
PT Citra Niaga Teknologi
 
The Spoofax Language Workbench (SPLASH 2010)
lennartkats
 
Kotlin for android
Shady Selim
 
Kotlin Multiplatfom In Action
Marko Mitic
 
Using Aspects for Language Portability (SCAM 2010)
lennartkats
 
CSP: Huh? And Components
Daniel Fagnan
 
Kotlin L → ∞
Abdellah SELASSI
 

Viewers also liked (12)

PPTX
Historia del computador
Marcela Barragan Campos
 
PDF
20160119_172712jpg
Enrico Passalacqua
 
PDF
Codes and Conventions
Jennifer Marsh
 
PDF
Manual de interpol_sobre_adn[1]
ATUX
 
PPT
Fourlsides
Dizavid
 
PPT
So You Say You Want Communication
mbamom
 
PPS
Kutna Hora
vegacan
 
PPTX
IMAGENES
albertocl22
 
PDF
Festa della Maggiolina
adrianocolombo
 
PDF
Residential Investment Advisory Report - Dec 2015
Knight Frank India
 
PPTX
Medicina legal tocoginecologica
Paulin Betancourt
 
PDF
Auto admisión de querella contra cupula sanitaria Madrid
Comuna Jurídica
 
Historia del computador
Marcela Barragan Campos
 
20160119_172712jpg
Enrico Passalacqua
 
Codes and Conventions
Jennifer Marsh
 
Manual de interpol_sobre_adn[1]
ATUX
 
Fourlsides
Dizavid
 
So You Say You Want Communication
mbamom
 
Kutna Hora
vegacan
 
IMAGENES
albertocl22
 
Festa della Maggiolina
adrianocolombo
 
Residential Investment Advisory Report - Dec 2015
Knight Frank India
 
Medicina legal tocoginecologica
Paulin Betancourt
 
Auto admisión de querella contra cupula sanitaria Madrid
Comuna Jurídica
 
Ad

Similar to Coding in kotlin (20)

PDF
A short introduction to the Kotlin language for Java developers
Antonis Lilis
 
PDF
Is this Swift for Android? A short introduction to the Kotlin language
Antonis Lilis
 
PDF
Android 101 - Kotlin ( Future of Android Development)
Hassan Abid
 
PPTX
Kotlin
Sudhanshu Vohra
 
PDF
9054799 dzone-refcard267-kotlin
Zoran Stanimirovic
 
PDF
Kotlin from-scratch
Franco Lombardo
 
PDF
Kotlin
Nodirbek Usmanov
 
PPTX
Introduction to Kotlin for Android developers
Mohamed Wael
 
PDF
Kotlin what_you_need_to_know-converted event 4 with nigerians
junaidhasan17
 
PPTX
Android Development with Kotlin course
GoogleDevelopersLeba
 
PPTX
Introduction to Kotlin Language and its application to Android platform
EastBanc Tachnologies
 
PPTX
Introduction to Kotlin
T.M. Ishrak Hussain
 
PDF
Kotlin for Android
Han Yin
 
PDF
Programming with Kotlin
David Gassner
 
PPTX
Kotlin – the future of android
DJ Rausch
 
PPTX
Kotlin
Ravi Pawar
 
PDF
Basics of kotlin ASJ
DSCBVRITH
 
PDF
Best kotlin Course in Jalandhar, Punjab
mandeepsondh0
 
PPTX
Kotlin Overview
Ekta Raj
 
PDF
A quick and fast intro to Kotlin
XPeppers
 
A short introduction to the Kotlin language for Java developers
Antonis Lilis
 
Is this Swift for Android? A short introduction to the Kotlin language
Antonis Lilis
 
Android 101 - Kotlin ( Future of Android Development)
Hassan Abid
 
9054799 dzone-refcard267-kotlin
Zoran Stanimirovic
 
Kotlin from-scratch
Franco Lombardo
 
Introduction to Kotlin for Android developers
Mohamed Wael
 
Kotlin what_you_need_to_know-converted event 4 with nigerians
junaidhasan17
 
Android Development with Kotlin course
GoogleDevelopersLeba
 
Introduction to Kotlin Language and its application to Android platform
EastBanc Tachnologies
 
Introduction to Kotlin
T.M. Ishrak Hussain
 
Kotlin for Android
Han Yin
 
Programming with Kotlin
David Gassner
 
Kotlin – the future of android
DJ Rausch
 
Kotlin
Ravi Pawar
 
Basics of kotlin ASJ
DSCBVRITH
 
Best kotlin Course in Jalandhar, Punjab
mandeepsondh0
 
Kotlin Overview
Ekta Raj
 
A quick and fast intro to Kotlin
XPeppers
 
Ad

Recently uploaded (20)

PDF
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
PDF
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
PDF
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
PDF
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 
PDF
Alexander Marshalov - How to use AI Assistants with your Monitoring system Q2...
VictoriaMetrics
 
PDF
Open Chain Q2 Steering Committee Meeting - 2025-06-25
Shane Coughlan
 
PPTX
Hardware(Central Processing Unit ) CU and ALU
RizwanaKalsoom2
 
PPTX
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
PDF
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
PDF
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
PDF
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
PPTX
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
PPTX
Empowering Asian Contributions: The Rise of Regional User Groups in Open Sour...
Shane Coughlan
 
PDF
AI + DevOps = Smart Automation with devseccops.ai.pdf
Devseccops.ai
 
PPTX
Foundations of Marketo Engage - Powering Campaigns with Marketo Personalization
bbedford2
 
PDF
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
PDF
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
PPTX
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PDF
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
PDF
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 
Alexander Marshalov - How to use AI Assistants with your Monitoring system Q2...
VictoriaMetrics
 
Open Chain Q2 Steering Committee Meeting - 2025-06-25
Shane Coughlan
 
Hardware(Central Processing Unit ) CU and ALU
RizwanaKalsoom2
 
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
Empowering Asian Contributions: The Rise of Regional User Groups in Open Sour...
Shane Coughlan
 
AI + DevOps = Smart Automation with devseccops.ai.pdf
Devseccops.ai
 
Foundations of Marketo Engage - Powering Campaigns with Marketo Personalization
bbedford2
 
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 

Coding in kotlin

  • 2. Discussion Summary • Kotlin • What ? • Why? • Where? • How?
  • 3. About Kotlin • New programming language that is a pragmatic, safe, concise, and interoperable alternative to Java. • With Kotlin, you can implement your projects with less code, a higher level of abstraction, and fewer annoyances. • Statically typed programming language (Not like other dynamically typed programming languages Groovy, JRuby). • [Note: However, in contrast to Java, Kotlin does not require you to specify the type of every variable explicitly in your source code. In many cases, the type of a variable can automatically be determined from context, and in those cases Kotlin allows you to omit the type. Here’s the simplest possible example of this: val x = 1]
  • 6. Explanation • We declare a simple data class with two properties: name and age. Age is null by default (if it isn’t specified). While creating a list of persons, you omit Alice’s age, so the default value null is used. Then you use the function maxBy to find the oldest person in a list. The lambda expression passed to the function takes one parameter, and we use "it" as the default name of that parameter. The "elvis" operator ?: returns zero if the age is null. Because Alice’s age is not specified, it is considered to be zero, so Bob wins the prize of being the oldest one.
  • 7. Why? • The primary goal of Kotlin is to work as a more concise, more productive and safer alternative to Java, suitable in all contexts where Java is used today.
  • 8. NullPointerException • Do you cry out loud every time you see a Null Pointer Exception in your bug tracker? Then Kotlin is your solution! • Kotlin’s support for nullable types, which lets you write more reliable programs by detecting possible null pointer exceptions at compile time.
  • 9. Where? • Building server-side code (typically backends of Web applications). • Building mobile applications that run on Android devices. • But Kotlin works in other contexts as well. For example, you can use RoboVM 1 to run Kotlin code on iOS devices. Or you can use Kotlin together with JavaFX 2 to build desktop applications. • In addition to Java, Kotlin also can be compiled to JavaScript, allowing you to run Kotlin code in the browser.
  • 10. Benefit of statically typed language • Performance: Calling methods is faster because in most cases there is no need to figure out at runtime which method needs to be called. • Reliability: The compiler verifies the correctness of the program, so there are fewer opportunities for crashes at runtime. • Maintainability: Working with unfamiliar code is easier because you can see what kind of objects the code is working with. • Tool support: Static typing enables reliable refactorings, code completion and other IDE features.
  • 11. How?
  • 12. Reference • Kotlin In Action • Kotlin Programming Language • Kotlin Language Documentation • Kotlin In Action Forum • Kotlin GitHub • https://github.com/JetBrains/Exposed • https://github.com/jetbrains/anko • Kotlin Tutorials • Kotlin Playground