Kenneth
04/23/2020, 2:28 PM!!
something that should be avoided?Evan R.
04/23/2020, 2:30 PM?.
), the elvis operator (?:
) or even throwing an exception if necessaryspand
04/23/2020, 2:31 PMval notNullableVal = nullableVal ?: error("Descriptive error message here")
Roger Home-Martinsen
04/23/2020, 2:54 PMBrendan Weinstein
04/23/2020, 2:57 PM?:
and ?.
often push the error somewhere downstream that may make less sense later on when you hear bug reports.
When you launch an improperly configured experiment and find out you missed a month of business insight, you'll wish that something had crashed during the rollout to catch your attention.
Logging non-fatal exceptions is great, but most teams I have been on end up with too much noise to do a good job picking up signal.
A blend of these two positions is to crash on developer build variants and log a non-fatal in production.Milan Hruban
04/23/2020, 4:50 PM!!
with checkNotNull/requireNotNull
and supply an informative messagespand
04/23/2020, 5:34 PM?: error("Yo")