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
Adnan A M
September 21, 2018
Programming
130
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Having fun with Kotlin fun()
Slides from my talk at droidcon Vienna 2018.
Adnan A M
September 21, 2018
More Decks by Adnan A M
See All by Adnan A M
Abridge Coding Guidelines
adnan321
0
78
A developer's guide to wealth
adnan321
0
290
What the Hook ?
adnan321
0
110
Scoping Your Storage
adnan321
2
190
What The Context ?
adnan321
2
240
Putting Work Manager To Work
adnan321
0
120
OOP To FP
adnan321
1
220
Putting Work Manager To Work
adnan321
1
210
A slice of Android Slices - droidcon London 2018
adnan321
0
130
Other Decks in Programming
See All in Programming
GKE アップグレード前に知っておきたい Blue/Green と PDB の関係
stkk
0
110
高専キャリア LT 発表内容
crysta1221
6
5k
AI時代に学ぶ 好きなルール 嫌いなルール Linter編
shorty5121
0
230
初心者DevRelとして参加者だった私が、DevRel Talks!#2に登壇するまでにしてきたこと
sokohirai
0
170
承認済みなのに差戻しできてしまうバグ、型で潰せます
shinchit
0
120
ALB ログから Trace を気合で繋げる技術
fohte
7
780
TSX の <Hoge<Fuga>> という構文に驚いた話 / tsx-type-argument-syntax
kanaru0928
0
240
属人化した知識を、 AIが辿れる地図にする
pkshadeck
PRO
1
220
思考垂れ流し開発 ~音声入力 × AIエージェント × 開発ハーネスによる試行錯誤~
npostring
0
460
【デモ】Kiroで体験する仕様駆動開発|設計からコーディングまでAIと進める開発フロー
cmkudo
0
520
AWS Transform Customによる Spring Boot 2.xから4.xへのVerUp
satoshi256kbyte
2
110
Go 1.27からのGODEBUG / Go 1.27 リリースパーティ #go127party
mazrean
0
260
Featured
See All Featured
Code Review Best Practice
trishagee
74
20k
Skip the Path - Find Your Career Trail
mkilby
1
200
Ethics towards AI in product and experience design
skipperchong
2
350
Google's AI Overviews - The New Search
badams
0
1.6k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
710
The browser strikes back
jonoalderson
0
1.6k
Agile that works and the tools we love
rasmusluckow
331
22k
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
Faster Mobile Websites
deanohume
310
32k
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
540
KATA
mclloyd
PRO
35
15k
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