Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
jeswin
on Dec 18, 2020
|
parent
|
context
|
favorite
| on:
A case study on strict null checks
I like Rust from what I've tried. But I'd have preferred something like this:
let file = file.unwrapOrPanicWith("file was null");
option.expect(message) doesn't semantically make sense.
steveklabnik
on Dec 18, 2020
|
next
[–]
There was some discussion about this when the method was named; you're not alone. In the end, it is what it is. You could define your own method like that if you really wanted to.
jack1243star
on Dec 18, 2020
|
prev
[–]
I read it as expect (prepare) for the worst!
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: