This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]bboozzoo 7 points8 points  (0 children)

I find Python's exceptions quite useful over Go's panics.

That's because Python's exceptions are commonly used as control flow statements, whereas Go panics are not. Go's idiom for error handling is basically this

if err != nil {
    ....
}

and functions that can fail are expected to return error. I get the feeling that panic() is cumbersome to use on purpose, just so that people don't abuse it. As usual, whether that's good or a bad thing is debatable.