programming languages
rust: includes no null and an optional type, a great way to prevent run time errors
also rust: includes an unwrap function that bypasses the safety of the optional type and can cause run time errors
programming languages
@Efi there's an option type!
it's either
Some(value)
or
None
so if your function needs to sometimes return nothing, you have to wrap it up in an option.
The point of this: you never get null pointer errors. Ever. Because the language knows if you forgot to check.
programming languages
@lizardsquid there's another way to not get null pointer errors: don't use pointers in user code
programming languages
@Efi sorry I didn't mean strictly pointers
you get the same problem in languages with null (or nil) but no pointers.
programming languages
@lizardsquid [functional rant]
programming languages
@Efi [functional agreement]
(I use haskell as my main language, so...)
programming languages
@lizardsquid I really need to Learn rust, I am more of a C & CPP user at the moment.
programming languages
@lizardsquid no null... what...
how do you say undefined, then?
how do you say return "I didn't find the number you wanted"?