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
76
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
200
A slice of Android Slices - droidcon London 2018
adnan321
0
130
Other Decks in Programming
See All in Programming
Laravelで学ぶ Webアプリケーションチューニング入門/web_application_tuning_101
hanhan1978
4
1.8k
Terraform標準の組織で AWS CDKをどう使うか
mu7889yoon
1
500
プロポーザルを書いてもらう
pvcresin
0
480
Building a Meta Ray-Ban display app
akkeylab
0
110
Lean は証明の正しさを確認するためだけのツールって思ってませんか?
inoueasei
1
150
Go言語とトイモデルで学ぶTransformerの気持ち / fukuokago23-transformer
monochromegane
0
170
GDG Korea Android: 2026 I/O Extended ~ What's new in Android development tools
pluu
0
220
AI時代に設計が 最大の生産性レバーになる 意図駆動開発とデータを消さない設計|Don't Delete Your Data or Your Intent — Design as the Deepest Lever in the AI Era
tomohisa
1
830
PHP初心者セッション2026 〜生成AIでは見えない裏側を知る:今だからLAMPを通して仕組みを学ぶ〜
kashioka
0
900
【QA Test Talk Vol.8】AI-DLC による Whole Team Approach の加速
pkshadeck
PRO
0
170
TSX の <Hoge<Fuga>> という構文に驚いた話 / tsx-type-argument-syntax
kanaru0928
0
220
S3 を使うアプリケーションをローカル完結で動かすことに全力を注いでみた / Running S3 Apps Offline
contour_gara
0
450
Featured
See All Featured
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.9k
The SEO Collaboration Effect
kristinabergwall1
1
520
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
460
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
First, design no harm
axbom
PRO
2
1.2k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Test your architecture with Archunit
thirion
1
2.3k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
370
エンジニアに許された特別な時間の終わり
watany
108
250k
The Invisible Side of Design
smashingmag
301
52k
Ruling the World: When Life Gets Gamed
codingconduct
0
290
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