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

Even if you don't know C its influence has clearly poisoned your thinking about this issue.

The whole point of the billion dollar mistake is that the null pointer isn't actually a pointer, we would not have a type which is "Either a String or, sometimes just for fun the integer 19" because that's silly, so we shouldn't have a type which is "Either a pointer to T or, sometimes just not".

The huge difference is that if you don't make this mistake you only have to care about that "it wasn't a pointer" case when it might not be a pointer. Once you've handled that you're done, but with the C-style pointer that Tony's lecture is about you can't tell whether that was done, at every point in the program if you see a pointer maybe it is null.

In both Rust and Ada the type system is strong enough to express this. It is very silly to pretend that Err(AllocError) is invalid, it's not invalid at all, maybe that value wasn't what you were hoping for but it's entirely valid.



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

Search: