![Fragmented - An Android Developer Podcast artwork](https://is2-ssl.mzstatic.com/image/thumb/Podcasts123/v4/00/f5/c0/00f5c0f5-91e8-c52a-3a5c-8187c4b43797/mza_4290848285973845015.jpg/100x100bb.jpg)
092: Learning Kotlin - dealing with static-ness and (companion) objects costs
Fragmented - An Android Developer Podcast
English - August 07, 2017 05:00 - 35 minutes - 32.3 MB - ★★★★★ - 53 ratingsTechnology Education How To android developer java androiddev kotlin Homepage Download Apple Podcasts Google Podcasts Overcast Castro Pocket Casts RSS feed
In this second episode of our learning Kotlin series, we talk about Kotlin’s support for static members or … lack thereof. Kotlin as a language was designed so that there’s no such thing as a “static member” in a class but there are times when having static members can be useful.
So what do we do in those cases? do we just avoid static members? are there better alternatives? what are the costs with some of these approaches?
Listen on to find out more!
Show Notes
Static alternatives
Package level functions (Kotlin docs)
Static constants in Kotlin
Object declarations
Objects vs companion objects
Cost of approaches
Where do i put my constants in Kotlin
Exploring Kotlin's hidden costs - Part 1
Kotlin discussion - best practices for top level declarations
Look at the fragmentedpodcast.com for some code snippets
Misc:
Ep.89 - Learning Kotlin: Properties a first class language feature
Kotlin in Action – Manning Publications
Sponsors
Rollbar - special offer: Bootstrap plan free for 90 days
Contact
@fragmentedcast [twitter.com]
@donnfelker and +DonnFelker
@kaushikgopal and +KaushikGopalIsMe