3 ms·
I think Dart's new way of declaring variables as null safe by default is very interesting. If you want a variable to be able to hold a null, you have to explici
by russellbeattie 6y ago
I think Dart's new way of declaring variables as null safe by default is very interesting. If you want a variable to be able to hold a null, you have to explicitly say so. It seems a less heavy-handed version of how Golang handles nil, and much better than the standard way of declaring variables in most any other language.
Maybe this is some common language thing I haven't seen before, but it seems an "obvious in retrospect" sort of idea.
- c-cube 6y agoIt's already in at least kotlin and typescript, not to mention the languages that simply don't have null.
- russellbeattie 6y agoInteresting. Typescript seems to need a --strictNullChecks flag, but yeah Kotlin does have this already. (Sadly, Kotlin is filled with so many bad ideas, it's hard to notice a good one.)