~/talk

Kotlin - Advanced Tricks

TalkinPortugueseat AndroidFest Campinas 2018 · 2018-10-19..10-20· [kotlin]
links:none on file
slides:none on file

Shows advanced Kotlin idioms and patterns: using repeat instead of loops, also/takeIf/takeUnless for ordered side effects and conditional chaining, overloading operator fun invoke to make factories/renderers callable for DSL-style code, building HTTP endpoints as block-style actions with receiver lambdas, using the Nothing type to model terminal states for compile-time safety, and delegating function-like behavior to objects. Examples are runnable snippets demonstrating each technique.

AI-written summary · about

  1. 0:00Introduction
  2. 1:04Repeat function
  3. 2:07Also function
  4. 4:58TakeIf and takeUnless
  5. 7:50Deep links with invoke
  6. 11:51DSLs with invoke
  7. 21:58Companion objects
  8. 28:53Nothing type
  9. 31:46Guard with Nothing
  10. 35:22Nothing in binary trees
  11. 37:08Result with Nothing
  12. 38:32Interface compliance
  13. 40:37Literal functions
  14. 43:53Conclusion & Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.