Open in app
Eric N
275 Followers
About

Sign in

275 Followers
About
Open in app
Eric N

Eric N

Jun 23, 2020·1 min read

I prefer “null” over default values like empty string, -1 or 0 most days

Eric N

Hiring Android engineer shorturl.at/bivJO Clean coder, walker & biker. Hater of inefficiency

Type-safe null is better, more efficient, and less verbose alternative to represent all sorts of “missing results”. Look at Kotlin standard library for inspiration, for example. There is String.toIntOrNull() functi…

Null is your friend, not a mistake
4.4K
25

Roman Elizarov

  • Kotlin
  • Java
  • Null

More from Eric N

Hiring Android engineer shorturl.at/bivJO Clean coder, walker & biker. Hater of inefficiency

More From Medium

Kotlin Mutable Map Write Performance

Eric N in The Startup

Supercharged Android MVVM — Input Stream

Eric N in ProAndroidDev

Greatest Android modularization mistake and how to undo it

Eric N in ProAndroidDev

Getting Frames of Live camera footage in Android using Camera2 API

Hamza Asif

How To Handle UI Events In Jetpack Compose

Ryan Michael Kay

Non-Programmer Welcome- Sum, Average and Other Data Set Fun With Kotlin

Eric N in The Startup

The snowplow-java-tracker in a multi-client service architecture

Julian Dobrot in upday devs

How the Most Dangerous Study of All Time Changed What We Know About Weight Loss

Michael Easter

About

Help

Legal

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store