Fragmented - Android Developer Podcast

092: Learning Kotlin - dealing with static-ness and (companion) objects costs


Listen Later

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
          • ...more
            View all episodesView all episodes
            Download on the App Store

            Fragmented - Android Developer PodcastBy Donn Felker, Kaushik Gopal

            • 5
            • 5
            • 5
            • 5
            • 5

            5

            68 ratings


            More shows like Fragmented - Android Developer Podcast

            View all
            Design Details by Brian Lovin, Marshall Bock

            Design Details

            361 Listeners

            Developer Tea by Jonathan Cutrell

            Developer Tea

            402 Listeners

            Does Not Compute by Sean Washington, Rockwell Schrock

            Does Not Compute

            53 Listeners

            Toolsday by Una Kravets, Chris Dhanaraj

            Toolsday

            48 Listeners

            Swift Unwrapped by JP Simard, Jesse Squires, Spec Network, Inc.

            Swift Unwrapped

            90 Listeners