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 

@lizardsquid no null... what...
how do you say undefined, then?
how do you say return "I didn't find the number you wanted"?

Follow

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.

· · 0 · 0 · 1

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 

@Efi [functional agreement]

(I use haskell as my main language, so...)

Sign in to participate in the conversation
Computer Fairies

Computer Fairies is a Mastodon instance that aims to be as queer, friendly and furry as possible. We welcome all kinds of computer fairies!