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
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
52
A developer's guide to wealth
adnan321
0
260
What the Hook ?
adnan321
0
88
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
200
Putting Work Manager To Work
adnan321
1
160
A slice of Android Slices - droidcon London 2018
adnan321
0
110
Other Decks in Programming
See All in Programming
AI Coding Meetup #3 - 導入セッション / ai-coding-meetup-3
izumin5210
0
3.3k
詳しくない分野でのVibe Codingで困ったことと学び/vibe-coding-in-unfamiliar-area
shibayu36
3
5k
スマホから Youtube Shortsを見られないようにする
lemolatoon
27
32k
ALL CODE BASE ARE BELONG TO STUDY
uzulla
19
5k
XP, Testing and ninja testing ZOZ5
m_seki
3
650
Range on Rails ―「多重範囲型」という新たな選択肢が、複雑ロジックを劇的にシンプルにしたワケ
rizap_tech
0
130
10年もののAPIサーバーにおけるCI/CDの改善の奮闘
mbook
0
820
技術的負債の正体を知って向き合う / Facing Technical Debt
irof
0
170
PHPに関数型の魂を宿す〜PHP 8.5 で実現する堅牢なコードとは〜 #phpcon_hiroshima / phpcon-hiroshima-2025
shogogg
1
220
Building, Deploying, and Monitoring Ruby Web Applications with Falcon (Kaigi on Rails 2025)
ioquatix
4
2.1k
Flutterで分数(Fraction)を表示する方法
koukimiura
0
130
開発生産性を上げるための生成AI活用術
starfish719
3
980
Featured
See All Featured
Build your cross-platform service in a week with App Engine
jlugia
232
18k
How GitHub (no longer) Works
holman
315
140k
Embracing the Ebb and Flow
colly
88
4.8k
Gamification - CAS2011
davidbonilla
81
5.5k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Into the Great Unknown - MozCon
thekraken
40
2.1k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.7k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
46
7.7k
Speed Design
sergeychernyshev
32
1.2k
Build The Right Thing And Hit Your Dates
maggiecrowley
37
2.9k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
33
2.3k
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