Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Having fun with Kotlin fun()
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Adnan A M
September 21, 2018
Programming
0
97
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
62
A developer's guide to wealth
adnan321
0
270
What the Hook ?
adnan321
0
92
Scoping Your Storage
adnan321
2
170
What The Context ?
adnan321
2
230
Putting Work Manager To Work
adnan321
0
110
OOP To FP
adnan321
1
210
Putting Work Manager To Work
adnan321
1
170
A slice of Android Slices - droidcon London 2018
adnan321
0
120
Other Decks in Programming
See All in Programming
Event Storming
hschwentner
3
1.3k
クライアントワークでSREをするということ。あるいは事業会社におけるSREと同じこと・違うこと
nnaka2992
1
300
受け入れテスト駆動開発(ATDD)×AI駆動開発 AI時代のATDDの取り組み方を考える
kztakasaki
2
520
LangChain4jとは一味違うLangChain4j-CDI
kazumura
1
140
AIコーディングの理想と現実 2026 | AI Coding: Expectations vs. Reality 2026
tomohisa
0
960
Ruby x Terminal
a_matsuda
6
570
エージェント開発初心者の僕がエージェントを作った話と今後やりたいこと
thasu0123
0
230
並行開発のためのコードレビュー
miyukiw
2
2.2k
SourceGeneratorのマーカー属性問題について
htkym
0
130
Go1.26 go fixをプロダクトに適用して困ったこと
kurakura0916
0
320
15年目のiOSアプリを1から作り直す技術
teakun
1
600
要求定義・仕様記述・設計・検証の手引き - 理論から学ぶ明確で統一された成果物定義
orgachem
PRO
19
10k
Featured
See All Featured
Done Done
chrislema
186
16k
Exploring anti-patterns in Rails
aemeredith
2
280
Facilitating Awesome Meetings
lara
57
6.8k
Are puppies a ranking factor?
jonoalderson
1
3.1k
We Have a Design System, Now What?
morganepeng
55
8k
The Curse of the Amulet
leimatthew05
1
9.5k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.1k
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
130
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
460
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
380
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