logoalt Hacker News

veggierolllast Tuesday at 10:27 PM2 repliesview on HN

I have yet to see a proposal that retains what I love about the status quo: conscientious error handling.

The language’s status quo forces everyone to think about errors more deeply than in other languages and acknowledges that the error case is as critical and worthy of the programmer’s attention.


Replies

thaynelast Wednesday at 1:01 AM

Something like:

    x := FallibleFunction() ? err -> return fmt.Errorf("something happened %v", err)
Doesn't really change that, but significantly reduces the amount of noise from error handling boilerplate. And (most importantly to me) reduces the amount of vertical space taken up by error handling code, which makes it easier to follow the happy flow.
show 3 replies
sedatklast Tuesday at 10:48 PM

> forces everyone to think about errors more deeply than in other languages

Not really. Rust also forces you think deeply about errors but don't bother you with verbose syntax. I think Swift was also similar.