Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Our stack is Typescript and Kotlin, and I find handling of null simple and safe, especially in Kotlin there is decent supporting functionality https://kotlinlang.org/docs/reference/null-safety.html

With Java we used @NotNull annotations and IDE support to give warnings. Luckily we are converting our legacy code base to Kotlin.

With conditional type conditions Typescript will have better support than earlier:

    type NonNullable<T> = Diff<T, null | undefined>;  // Remove null and undefined from T
Source and the examples in: https://github.com/Microsoft/TypeScript/pull/21316


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: