Eugen Martynov
10/11/2024, 12:01 PMBoolean?.orFalse()
?ephemient
10/11/2024, 2:45 PMEugen Martynov
10/11/2024, 2:46 PMselectedDate?.isBefore(latestDate) == true
felt it would be easier to read
selectedDate?.isBefore(latestDate).orFalse()
trying to avoid cognitive load about nullabilityEugen Martynov
10/11/2024, 2:49 PMCLOVIS
10/12/2024, 9:21 AM(selectedDate ?: Instant.DISTANT_FUTURE).isBefore(latestDate)
CLOVIS
10/12/2024, 9:21 AMLeoColman
10/17/2024, 12:19 PMKlitos Kyriacou
10/17/2024, 1:18 PM== true
idiom is commonplace and easily recognized as a check of a nullable Boolean. I don't think there's any need to invent workarounds.