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
0
89
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
38
A developer's guide to wealth
adnan321
0
250
What the Hook ?
adnan321
0
73
Scoping Your Storage
adnan321
2
140
What The Context ?
adnan321
2
200
Putting Work Manager To Work
adnan321
0
92
OOP To FP
adnan321
1
190
Putting Work Manager To Work
adnan321
1
150
A slice of Android Slices - droidcon London 2018
adnan321
0
100
Other Decks in Programming
See All in Programming
php-conference-japan-2024
tasuku43
0
430
DevFest - Serverless 101 with Google Cloud Functions
tunmise
0
140
ISUCON14感想戦で85万点まで頑張ってみた
ponyo877
1
590
GitHub CopilotでTypeScriptの コード生成するワザップ
starfish719
26
6k
カンファレンス動画鑑賞会のススメ / Osaka.swift #1
hironytic
0
170
知られざるDMMデータエンジニアの生態 〜かつてツチノコと呼ばれし者〜
takaha4k
1
420
ecspresso, ecschedule, lambroll を PipeCDプラグインとして動かしてみた (プロトタイプ) / Running ecspresso, ecschedule, and lambroll as PipeCD Plugins (prototype)
tkikuc
2
1.8k
ChatGPT とつくる PHP で OS 実装
memory1994
PRO
3
190
KMP와 kotlinx.rpc로 서버와 클라이언트 동기화
kwakeuijin
0
300
歴史と現在から考えるスケーラブルなソフトウェア開発のプラクティス
i10416
0
300
PHPUnitしか使ってこなかった 一般PHPerがPestに乗り換えた実録
mashirou1234
0
420
PicoRubyと暮らす、シェアハウスハック
ryosk7
0
210
Featured
See All Featured
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.9k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.1k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
7k
It's Worth the Effort
3n
183
28k
What's in a price? How to price your products and services
michaelherold
244
12k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Fashionably flexible responsive web design (full day workshop)
malarkey
406
66k
jQuery: Nuts, Bolts and Bling
dougneiner
62
7.6k
Agile that works and the tools we love
rasmusluckow
328
21k
Writing Fast Ruby
sferik
628
61k
How GitHub (no longer) Works
holman
312
140k
The Power of CSS Pseudo Elements
geoffreycrofte
74
5.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