top | item 45976780

(no title)

richardwhiuk | 3 months ago

Because Go silently gives you zero/null instead

discuss

order

karel-3d|3 months ago

Idiomatically, it gives you `err` and you do `if err != nil {return err}`. While in rust you mostly do `.unwrap` and panic.

It's not in the type system, but it's idiomatic

richardwhiuk|3 months ago

Get a key from a map and forget to check the error.

ergocoder|3 months ago

which mean an unexpected behavior could go unnoticed for a long time.

I'd prefer a loud crash over that.

karel-3d|3 months ago

Well look at the failure modes in the original article.

In the original PHP code, all worked, only it didn't properly check for bots.

The new Rust code did a loud crash and took off half of the internet.