Fragmented - Android Developer Podcast

176: Kotlin's !! Operator is a Code Smell


Listen Later

Kotlin isn't a magic bullet that prevents NullPointerExceptions.

Not at all.

What Kotlin does do is force you to think about how you want to handle your nulls. through Kotlin forcing you to think this through, the hope is that you'll avoid NullPointerExceptions. The only problem is, Kotlin has the !! operator, also known as the "Not Null Assertion Operator". This operator basically says "Hey Kotlin, trust me, I'm a pro, I know what I'm doing ... I KNOW THIS WON'T BE NULL".

This... is a code smell.

In this episode, Donn walks through why Kotlin's Not Null Assertion Operator (!!) is a code smell and what you can do to alleviate it.

Thanks To This Week's Sponsor: Bitrise

Build amazing apps in Java, Kotlin or whatever tech you prefer and use Bitrise to automate your Android integration, build, test and deploy process quickly and easily. Sign up for an exquisite pair of Bitrise Branded Socks, here! https://go.bitrise.io/fragmented

Contact
  • Discord chat or @fragmentedcast or our Youtube channel
  • @donnfelker and donnfelker (on Instagram)
  • @kaushikgopal and kaushikgopal (on Instagram)
  • ...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

    67 ratings


    More shows like Fragmented - Android Developer Podcast

    View all
    Planetary Radio: Space Exploration, Astronomy and Science by The Planetary Society

    Planetary Radio: Space Exploration, Astronomy and Science

    1,337 Listeners

    Das Wissen | SWR by SWR

    Das Wissen | SWR

    111 Listeners

    Motley Fool Money by The Motley Fool

    Motley Fool Money

    3,191 Listeners

    Design Details by Brian Lovin, Marshall Bock

    Design Details

    360 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

    Morning Brew Daily by Morning Brew

    Morning Brew Daily

    2,973 Listeners

    Now in Android by Now in Android

    Now in Android

    6 Listeners

    A Bit of Optimism by Simon Sinek

    A Bit of Optimism

    2,146 Listeners

    The Pragmatic Engineer by Gergely Orosz

    The Pragmatic Engineer

    62 Listeners