News for hackers. Stuff that matters.
Re:Effective Rust by rovolo on Thursday June 15, 2023 @02:46PM (#36344881)
> Java with checked vs unchecked exceptions

Java doesn't make it nice to deal with exceptions though. Converting a checked exception into an unchecked exception is incredibly wordy:

    int output;
    try {
        output = doSomething();
    } catch (IOException io) {
        throw new RuntimeException(io);
    }
vs Rust's method of defaulting an error result to a panic:

    let output = doSomething().unwrap()
https://doc.rust-lang.org/std/result/

There are no comments on this comment yet.