News for hackers. Stuff that matters.
Re:Where Everything Went Wrong: Error Handling and Error Mes... by kelnos on Friday February 19, 2021 @05:00PM (#26198588)
There's no "forcing" there. You can simply ignore the error part of the tuple, or even just forget to check it.

If the function returns a (non-error) value that is directly accessible from the function call, the programmer is not forced to do anything with the error.

This is exactly the same problem with null: forget a null check, and you're hosed. Forget an error check, and you're hosed.

If you make errors a part of the actual single return type (as Rust does), then you have to explicitly deal with the possibility of an error before you are even allowed to touch the successful case.

There are no comments on this comment yet.