~/talk

Early returns from outer space (in Kotlin)

Talkat Voxxed Days Amsterdam 2026 Β· 2026-04-01..04-02Β· [kotlin]
slides:none on file

Kotlin lets a return inside a lambda actually exit the surrounding function because the compiler inlines functions, copying lambda bodies into the call site so returns, breaks and continues behave like native control flow. The code example builds a first-contact scenario with ships, nullable commanders and carbon-based aliens and shows smart casts refining types after early returns so properties like origin are accessible without casts. This works for collection ops and resource helpers but increases code size, so use inlining selectively.

AI-written summary Β· about

  1. 0:00Introduction to Kotlin talk
  2. 1:25Expression-based bodies in Kotlin
  3. 2:29Why early returns matter
  4. 3:11Domain model for alien contact
  5. 5:55Smart casting explained
  6. 8:23Advantages of smart casting
  7. 9:25Early returns with crew contact
  8. 10:49Inline functions and control flow
  9. 13:14Summary of Kotlin features
  10. 13:57Q&A on inline functions
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 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
← β†’
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
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.