Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Having fun with Kotlin fun()
Search
Adnan A M
September 21, 2018
Programming
0
96
Having fun with Kotlin fun()
Slides from my talk at droidcon Vienna 2018.
Adnan A M
September 21, 2018
Tweet
Share
More Decks by Adnan A M
See All by Adnan A M
Abridge Coding Guidelines
adnan321
0
54
A developer's guide to wealth
adnan321
0
260
What the Hook ?
adnan321
0
89
Scoping Your Storage
adnan321
2
160
What The Context ?
adnan321
2
220
Putting Work Manager To Work
adnan321
0
100
OOP To FP
adnan321
1
210
Putting Work Manager To Work
adnan321
1
170
A slice of Android Slices - droidcon London 2018
adnan321
0
110
Other Decks in Programming
See All in Programming
FluorTracer / RayTracingCamp11
kugimasa
0
180
Integrating WordPress and Symfony
alexandresalome
0
120
堅牢なフロントエンドテスト基盤を構築するために行った取り組み
shogo4131
5
1.9k
関数実行の裏側では何が起きているのか?
minop1205
1
490
AIコーディングエージェント(Manus)
kondai24
0
110
S3 VectorsとStrands Agentsを利用したAgentic RAGシステムの構築
tosuri13
4
260
Reactive Thinking with Signals and the new Resource API
manfredsteyer
PRO
0
160
AIエージェントを活かすPM術 AI駆動開発の現場から
gyuta
0
220
How Software Deployment tools have changed in the past 20 years
geshan
0
27k
CSC509 Lecture 14
javiergs
PRO
0
220
WebRTC と Rust と8K 60fps
tnoho
2
1.9k
connect-python: convenient protobuf RPC for Python
anuraaga
0
350
Featured
See All Featured
Code Review Best Practice
trishagee
73
19k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.3k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
36
6.2k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.3k
Embracing the Ebb and Flow
colly
88
4.9k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
37
2.6k
The Art of Programming - Codeland 2020
erikaheidi
56
14k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.1k
How to Think Like a Performance Engineer
csswizardry
28
2.3k
Building Flexible Design Systems
yeseniaperezcruz
329
39k
A Modern Web Designer's Workflow
chriscoyier
697
190k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.4k
Transcript
Having fun with Kotlin fun()
What is a function ?
“ Quote a long definition from Wikipedia here….. OR fun
myFunction() { // pretty awesome function right here }
Kotlin, give us a function !
Kotlin, give us a function !
Local Functions Functions within functions
None
Can’t unit test inner function Caveats/Gotchas Kotlin function doesn’t see
local declarations in advance
Single Expression Functions
None
Top Level Functions Extend functionality
Extension Functions Extend functionality
Extension function
Resolved Statically Under the hood Receiver Object The static function
is passed in the receiver object as a parameter
Companion objects/Static classes Caveats/Gotchas Member Functions Win
Named Arguments Thou shall name parameters
None
None
None
None
Default Parameters
None
Java interop isn’t great, must specify all parameters when calling
Caveats/Gotchas
Lambda Expressions
None
Anonymous functions
None
Higher Order Functions
None
None
None
None
None
None
None
inline functions
None
None
Let’s inline all Higher Order Functions ! Caveats/Gotchas No access
to private variables/members
None
Non local returns
None
None
None
None
None
Standard Functions
“ let, also, apply, run & with
None
None
“ Scoping functions
let
Usage of let
None
apply
Usage of apply
None
also
Usage of also
None
run
Usage of run
None
“ Transformation vs Mutating functions
“ also, apply - Mutating Functions
“ run, let - Transformation Functions
Danke Any questions? You can find me at: ◇ @AdnanM0123
Slide Theme ◇ Presentation template by SlidesCarnival ◇ Photographs by
Unsplash