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
87
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
240
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
99
Other Decks in Programming
See All in Programming
「とりあえず動く」コードはよい、「読みやすい」コードはもっとよい / Code that 'just works' is good, but code that is 'readable' is even better.
mkmk884
3
270
20年もののレガシープロダクトに 0からPHPStanを入れるまで / phpcon2024
hirobe1999
0
460
PHPとAPI Platformで作る本格的なWeb APIアプリケーション(入門編) / phpcon 2024 Intro to API Platform
ttskch
0
220
The Efficiency Paradox and How to Save Yourself and the World
hollycummins
1
440
Amazon S3 NYJavaSIG 2024-12-12
sullis
0
100
php-conference-japan-2024
tasuku43
0
270
42 best practices for Symfony, a decade later
tucksaun
1
180
これが俺の”自分戦略” プロセスを楽しんでいこう! - Developers CAREER Boost 2024
niftycorp
PRO
0
190
フロントエンドのディレクトリ構成どうしてる? Feature-Sliced Design 導入体験談
osakatechlab
8
4.1k
ゆるやかにgolangci-lintのルールを強くする / Kyoto.go #56
utgwkk
2
380
Recoilを剥がしている話
kirik
5
6.7k
SymfonyCon Vienna 2025: Twig, still relevant in 2025?
fabpot
3
1.2k
Featured
See All Featured
Building an army of robots
kneath
302
44k
Practical Orchestrator
shlominoach
186
10k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.1k
The World Runs on Bad Software
bkeepers
PRO
65
11k
How to Ace a Technical Interview
jacobian
276
23k
Code Review Best Practice
trishagee
65
17k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.5k
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.4k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
95
17k
Unsuck your backbone
ammeep
669
57k
Building a Scalable Design System with Sketch
lauravandoore
460
33k
The Cost Of JavaScript in 2023
addyosmani
45
7k
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