News for hackers. Stuff that matters.
Re:Go’ing Insane: Endless Error Handling by tored on Tuesday September 14, 2021 @07:20AM (#28523010)
try/catch can be as much as verbose

    try {
        foo();
        val = bar();
        baz();
    } catch (Exception $e) {
        // all lumped together, not good
    }
    
    try {
        foo();
        val = bar();
        baz();
    } catch (RangeException $e) {
        // who is throwing what?
    } catch (NotFoundException $e) {
        // who is throwing what?
    } catch (SomeOtherException $e) {
        // who is throwing what?
    }
    
    try {
        foo();
    } catch (SomeOtherException $e) {
        // very verbose
    }
    
    try {
        val = bar();
    } catch (NotFoundException $e) {
        // very verbose
    }
    
    try {
        baz();
    } catch (RangeException $e) {
        // very verbose
    }
Re:Go’ing Insane: Endless Error Handling by vips7L on Tuesday September 14, 2021 @07:57AM (#28523346)
That’s only if you’re actually handling your exceptions. The author of the post isn’t handling errors he’s just propagating.

When just propagating, exceptions have no verbosity:

   foo();
   bar();
   baz();
Re:Go’ing Insane: Endless Error Handling by masklinn on Tuesday September 14, 2021 @10:33AM (#28525424)
I don’t think “in the worst case scenario imaginable exceptions are as verbose as Go’s baseline” is much of a slam dunk.
Re:Go’ing Insane: Endless Error Handling by daoman on Wednesday September 15, 2021 @12:01AM (#28535124)
Wow, that's an excellent illustration!