SlideShare a Scribd company logo
Sharing Café
Sharing Café
WHAT IS KOTLIN?
Kotlin is a Russian island between Saint Petersburg and
the Gulf of Finland
Kotlin is a programming language
created by JetBrains
A FEW YEARS AGO…
Sharing Café
•It was in 2011 that JetBrains revealed the development of the
Kotlin Project
•One of the Kotlin Project goals was to compile as quickly as
Java
•Kotlin v1.0 was released in February 2015
•At Google I/O 2017 it was announced that Android is officially
supporting Kotlin language
•In November 2017 the v1.2 was released with a feature about
sharing code between JVM and JavaScript platforms
SOME TOP FEATURES
Sharing Café
Extension function
Higher-order function
Destructuring declaration
Singleton
Null safety
Allows you to write less code
Inter-operable with Java
EXTENSION FUNCTION
Sharing Café
Provides the ability to extend a class with new functionality without having
to inherit from the class or use any type of design pattern.
Receiver type
Receiver object
Extension function are resolved statically, i.e. does not modify classes that
they extend. They merely make new function callable with dot-notation.
HIGH-ORDER FUNCTION
Sharing Café
Function that takes functions as parameters, or returns a function.
Function in Kotlin are first class, which means that they can be stored in
variables and data structures, so that they can be passed as arguments to
other high-order functions.
outputConversion is a function that
accept a function as argument
with signature (Double) -> Double
converterFunc can be
celsiusToKelvin or
celsiusToFahrenheit that are
functions that accept a Double as
argument and returns a Double.
Function references
Sharing Café
HIGH-ORDER FUNCTION - 2
Function can also be returned as a data type simply by declaring the type of
the function as the return type
DESTRUCTURING DECLARATION
Sharing Café
This feature allows you to create multiple variables in one shot
Can also be used with return value
SINGLETON
Sharing Café
It’s simple to define a Singleton. It is sufficient to use the keyword object
which allows you to define an object which exists only as a single instance.
Java way Kotlin way
• object can’t have a
constructor
• init blocks are allowed if
some initialization code is
needed
• init block will be executed
lazily upon first access, in a
thread-safe way
SINGLETON WITH COMPANION
Sharing Café
Kotlin does not have static keyword. How do we set static variables and
methods?
companion object is the equivalent to static objects in Java
• companion object is common to all instances of the classes
• Is initialized when the class is instantiated
• Cannot be declared outside the class
NULL POINTER EXCEPTIONS
Sharing Café
I call it my billion-dollar mistake. It was the invention of null
reference in 1965.
- Tony Hoare
NULL SAFETY
Sharing Café
You need to say explicitly that a variable is nullable in order to be able to assign null to
it. This can be accomplished using the ? operator
• By default variables are declared as
not nullable
• To allow nulls we need to use the ?
operator
• ? operator can be used in safe cast
SO, TO CONCLUDE WE HAVE…
Sharing Café
1. Kotlin increases productivity
2. Kotlin is ready for production
• Increased readability
• Includes modern features
• Improved safety
• So, we can focus on more important things
• IntelliJ has parts written in Kotlin
• Spring 5 introduces Kotlin support
• TIOBE top 50 (41 position)
• More than 150k devs use Kotlin

More Related Content

PPTX
Ansible, Idempotency, and Jenkins
PPTX
10/29 Austin Ansible MeetUp - AnsibleFest Talk & Extending Ansible
PDF
EEF : Sexy Properties, Wizards and Views - EclipseCon 11
PPTX
Why Kotlin?
PDF
GEF SVG export in JWT: a newcomer’s rocky ride to Eclipse
PPTX
Rockstar Night - Spring, migrating to functional configuration
PPTX
What's new with Kotlin - Google IO18' extended Covenant University.
PDF
Trunk based development
Ansible, Idempotency, and Jenkins
10/29 Austin Ansible MeetUp - AnsibleFest Talk & Extending Ansible
EEF : Sexy Properties, Wizards and Views - EclipseCon 11
Why Kotlin?
GEF SVG export in JWT: a newcomer’s rocky ride to Eclipse
Rockstar Night - Spring, migrating to functional configuration
What's new with Kotlin - Google IO18' extended Covenant University.
Trunk based development

What's hot (20)

PDF
Trunk-Based Development and Toggling
PDF
Scaling up development of a modular code base
PPTX
Electrode Native Platform
PDF
Kotlin
PPTX
Code like a ninja session 3 open-closed principle
PDF
Zero downtime deployments for Sling application using Docker
PDF
Cross platform development
PDF
Scala Support in Eclipse - Monkey-patching the JDT for fun and profit?
PDF
Learn Elixir at Manchester Lambda Lounge
PDF
The Architect Way - JSCamp.asia 2012
PDF
Git Ready! Workflows
PPTX
Functional solid
PPTX
Functional Solid, Aleksandr Sugak
PPTX
PPTX
React native - React(ive) Way To Build Native Mobile Apps
PPTX
Effective Code Review (Or How To Alienate Your Coworkers)
PPT
Bridging the Gap - Laracon 2013
PDF
Using TypeScript with Angular
PDF
React Native Introduction: Making Real iOS and Android Mobile App By JavaScript
PDF
We all need friends and Akka just found Kubernetes
Trunk-Based Development and Toggling
Scaling up development of a modular code base
Electrode Native Platform
Kotlin
Code like a ninja session 3 open-closed principle
Zero downtime deployments for Sling application using Docker
Cross platform development
Scala Support in Eclipse - Monkey-patching the JDT for fun and profit?
Learn Elixir at Manchester Lambda Lounge
The Architect Way - JSCamp.asia 2012
Git Ready! Workflows
Functional solid
Functional Solid, Aleksandr Sugak
React native - React(ive) Way To Build Native Mobile Apps
Effective Code Review (Or How To Alienate Your Coworkers)
Bridging the Gap - Laracon 2013
Using TypeScript with Angular
React Native Introduction: Making Real iOS and Android Mobile App By JavaScript
We all need friends and Akka just found Kubernetes
Ad

Similar to Kotlin top features overview (20)

PPTX
Kotlin Overview
PDF
Kotlin vs Java-A Comparison for Application Development Projects.pdf
PDF
Kotlin Online Training.pdf
PDF
Kotlin Online Training.pdf
PDF
Kotlin Online Training.pdf
PDF
Kotlin Online Training.pdf
PDF
Kotlin Online Training.pdf
PDF
Kotlin Online Training.pdf
PDF
Kotlin Online Training.pdf
PDF
Kotlin Online Training.pdf
PDF
Kotlin Online Training.pdf
PDF
Kotlin Online Training.pdf
PDF
Kotlin Online Training.pdf
PDF
Kotlin for Android
PPTX
Kotlin - A Programming Language
PPTX
Introduction to Kotlin
PPSX
Kotlin Language powerpoint show file
PDF
Introduction to Kotlin - Android KTX
PPTX
Say Goodbye To Java: Getting Started With Kotlin For Android Development
Kotlin Overview
Kotlin vs Java-A Comparison for Application Development Projects.pdf
Kotlin Online Training.pdf
Kotlin Online Training.pdf
Kotlin Online Training.pdf
Kotlin Online Training.pdf
Kotlin Online Training.pdf
Kotlin Online Training.pdf
Kotlin Online Training.pdf
Kotlin Online Training.pdf
Kotlin Online Training.pdf
Kotlin Online Training.pdf
Kotlin Online Training.pdf
Kotlin for Android
Kotlin - A Programming Language
Introduction to Kotlin
Kotlin Language powerpoint show file
Introduction to Kotlin - Android KTX
Say Goodbye To Java: Getting Started With Kotlin For Android Development
Ad

Recently uploaded (20)

PPTX
history of c programming in notes for students .pptx
PDF
Nekopoi APK 2025 free lastest update
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
System and Network Administraation Chapter 3
PDF
System and Network Administration Chapter 2
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
AI in Product Development-omnex systems
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PPTX
ai tools demonstartion for schools and inter college
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
top salesforce developer skills in 2025.pdf
PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PPTX
L1 - Introduction to python Backend.pptx
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
Digital Strategies for Manufacturing Companies
history of c programming in notes for students .pptx
Nekopoi APK 2025 free lastest update
Design an Analysis of Algorithms I-SECS-1021-03
System and Network Administraation Chapter 3
System and Network Administration Chapter 2
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
AI in Product Development-omnex systems
2025 Textile ERP Trends: SAP, Odoo & Oracle
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
ai tools demonstartion for schools and inter college
Softaken Excel to vCard Converter Software.pdf
Odoo Companies in India – Driving Business Transformation.pdf
top salesforce developer skills in 2025.pdf
How Creative Agencies Leverage Project Management Software.pdf
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
wealthsignaloriginal-com-DS-text-... (1).pdf
L1 - Introduction to python Backend.pptx
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Digital Strategies for Manufacturing Companies

Kotlin top features overview

  • 2. Sharing Café WHAT IS KOTLIN? Kotlin is a Russian island between Saint Petersburg and the Gulf of Finland Kotlin is a programming language created by JetBrains
  • 3. A FEW YEARS AGO… Sharing Café •It was in 2011 that JetBrains revealed the development of the Kotlin Project •One of the Kotlin Project goals was to compile as quickly as Java •Kotlin v1.0 was released in February 2015 •At Google I/O 2017 it was announced that Android is officially supporting Kotlin language •In November 2017 the v1.2 was released with a feature about sharing code between JVM and JavaScript platforms
  • 4. SOME TOP FEATURES Sharing Café Extension function Higher-order function Destructuring declaration Singleton Null safety Allows you to write less code Inter-operable with Java
  • 5. EXTENSION FUNCTION Sharing Café Provides the ability to extend a class with new functionality without having to inherit from the class or use any type of design pattern. Receiver type Receiver object Extension function are resolved statically, i.e. does not modify classes that they extend. They merely make new function callable with dot-notation.
  • 6. HIGH-ORDER FUNCTION Sharing Café Function that takes functions as parameters, or returns a function. Function in Kotlin are first class, which means that they can be stored in variables and data structures, so that they can be passed as arguments to other high-order functions. outputConversion is a function that accept a function as argument with signature (Double) -> Double converterFunc can be celsiusToKelvin or celsiusToFahrenheit that are functions that accept a Double as argument and returns a Double. Function references
  • 7. Sharing Café HIGH-ORDER FUNCTION - 2 Function can also be returned as a data type simply by declaring the type of the function as the return type
  • 8. DESTRUCTURING DECLARATION Sharing Café This feature allows you to create multiple variables in one shot Can also be used with return value
  • 9. SINGLETON Sharing Café It’s simple to define a Singleton. It is sufficient to use the keyword object which allows you to define an object which exists only as a single instance. Java way Kotlin way • object can’t have a constructor • init blocks are allowed if some initialization code is needed • init block will be executed lazily upon first access, in a thread-safe way
  • 10. SINGLETON WITH COMPANION Sharing Café Kotlin does not have static keyword. How do we set static variables and methods? companion object is the equivalent to static objects in Java • companion object is common to all instances of the classes • Is initialized when the class is instantiated • Cannot be declared outside the class
  • 11. NULL POINTER EXCEPTIONS Sharing Café I call it my billion-dollar mistake. It was the invention of null reference in 1965. - Tony Hoare
  • 12. NULL SAFETY Sharing Café You need to say explicitly that a variable is nullable in order to be able to assign null to it. This can be accomplished using the ? operator • By default variables are declared as not nullable • To allow nulls we need to use the ? operator • ? operator can be used in safe cast
  • 13. SO, TO CONCLUDE WE HAVE… Sharing Café 1. Kotlin increases productivity 2. Kotlin is ready for production • Increased readability • Includes modern features • Improved safety • So, we can focus on more important things • IntelliJ has parts written in Kotlin • Spring 5 introduces Kotlin support • TIOBE top 50 (41 position) • More than 150k devs use Kotlin