3 ms·
> * Rust does not have NULL!! That hardly strikes me as a feature. Null pointers simplify a lot of error-checking. Don't know if what you got back was valid?
by burgerbrain 16y ago
> * Rust does not have NULL!!
That hardly strikes me as a feature. Null pointers simplify a lot of error-checking. Don't know if what you got back was valid? As easy as checking to see if it's zero!
- silentbicycle 16y agoThe last time I checked, it was bootstrapped in OCaml. When I met Graydon several years ago (brilliant dude, PS), he was quite intrigued by OCaml, and strongly recommended I check it out. If ML had any influence at all, it uses variant types instead. About time more languages use them! Rather than, "oh crap! every single variable could potentially be null at any time!", the few functions that can be null make you check for None / Some 'a, and that's it, no tedious null checks ever again. "Null pointers simplify a lot of error-checking.", my ass.
- effn 16y agoYes, it does have variant types and pattern matching, and an option type in the standard library, just like ML. Contrary to ML, it doesn't require variables to be initialized when declared. The typestate system checks (statically) that they are not referenced before initialized.
- thesz 16y ago>Contrary to ML, it doesn't require variables to be initialized when declared. The typestate system checks (statically) that they are not referenced before initialized. What's the point, then?
- BrendanEich 16y agoThink again. Null pointers were a "billion dollar mistake" (http://lambda-the-ultimate.org/node/3186 http://lambda-the-ultimate.org/node/3186) according to C.A.R. Hoare (no relation to Graydon). Look deeper, there is a rich world of Programming Language history and research linked from Rust's FAQ. Don't cling to your Java or C/C++ null pointers.