2 ms·
Because you can forget a null-check, but the type system won't let you forget an option/not_null? It's the same reason we complicate things with type systems in
by johncolanduoni 11y ago
Because you can forget a null-check, but the type system won't let you forget an option/not_null? It's the same reason we complicate things with type systems in general.
- halayli 11y agoIt's more for consistency. You can still forget to use a not_null.
- johncolanduoni 11y agoNot if you're calling into an API that uses not_null; it will automatically insert the null check.
- halayli 11y agoMy point is that you can easily forget to declare a pointer as not_null and revert back to the old habit of declaring it as int*. The responsibility is still on the programmer.