Hacker News new | past | comments | ask | show | jobs | submit login

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.




It's already in at least kotlin and typescript, not to mention the languages that simply don't have null.


Interesting. 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.)




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

Search: