News for hackers. Stuff that matters.
Re:Overhead of Returning Optional Values in Java and Rust by convolvatron on Saturday October 16, 2021 @01:13PM (#28889401)
for me this is one of the bigger festering wounds in programming. error handling doubles the size of the code. error handling is complicated.

so we put on our big-dev pants and build all sorts of structures around handling errors to make it more sound/ergonomic.

but at the end of the day:

   o its still very difficult to respond in a semantically meaningful way to errors as code

   o they still almost always just get dumped into a log or ignored, or just result in a panic

   o even if we have managed to surface them - they still aren't really that actionable by the end user
so we haven't helped the situation much, but some of these answer like catch/throw have really unpleasant consequences - we may have made it worse
Re:Overhead of Returning Optional Values in Java and Rust by valenterry on Saturday October 16, 2021 @09:40PM (#28893233)
It's pretty much a solved problem. Just use a language that has better ergonomics for errors.

Scala's ZIO is one of the better examples if you are interested to look into an alternative.