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
AI時代に設計が 最大の生産性レバーになる 意図駆動開発とデータを消さない設計|Don't Delete Your Data or Your Intent — Design as the Deepest Lever in the AI Era
tomohisa
1
740
Laravel Boostに学ぶ、AIにPHPを書かせる技術 〜OSSの実装から蒸留するエージェント制御の王道〜
kentaroutakeda
3
670
【QA Test Talk Vol.8】AI-DLC による Whole Team Approach の加速
pkshadeck
PRO
0
120
作るコストが小さくなった時代 幸せに働くために改めて考えたいこと 〜エンジニアとして価値を出し続けるために注視している二分野〜
yuppeeng
0
190
the container ship “Apple Silicon”@WWDC26 Recap -Japan-\(region).swift
shingangan
0
110
AWS DevOps AgentのAzure接続機能を検証して見えた活用法/Use Cases Verified for the AWS DevOps Agent's Azure Connectivity Feature
masakiokuda
1
220
torikago - Ruby::Boxで照らすモジュラモノリスの実行境界
se4weed
1
350
Lean は証明の正しさを確認するためだけのツールって思ってませんか?
inoueasei
1
150
プロポーザルを書いてもらう
pvcresin
0
290
生成AIで帳票OCRが「簡単に」作れる時代になった?
kon_shou
0
650
源内ハンズオン概要編
hideg
0
140
freee が目指す データ マネジメント戦略 AI-Ready 時代を支える 攻めのガバナンスとは
freee
PRO
0
310
Featured
See All Featured
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2.1k
Embracing the Ebb and Flow
colly
88
5.1k
A Modern Web Designer's Workflow
chriscoyier
698
190k
Producing Creativity
orderedlist
PRO
348
40k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
410
Being A Developer After 40
akosma
91
590k
GraphQLとの向き合い方2022年版
quramy
50
15k
RailsConf 2023
tenderlove
30
1.5k
The Invisible Side of Design
smashingmag
301
52k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.5k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
3
1.1k
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