I disagree with error handling proposals that hide the program flow's 
branching statements. 

In 1976, Thomas McCabe found a correlation between branching statements and 
bugs. His cyclomatic complexity uses program flow to measure code 
complexity. It is important that branching statements be plain and clear to 
help catch errors.

On the more practical level, we usually scan our codes, and we read only 
the relevant parts. When we scan, it is helpful to have these branching 
statements stand out. Anything that conceals these branching statements 
makes the code difficult to scan.

The proposed "throw" statement obscures the error-related branching 
statements. If an error occurs, it is not clear which part of the code 
block the error comes from. 

The current Go's error handling is not perfect. It is still preferable than 
many error handling proposals I have read so far. So, not everybody in the 
Go community finds the current error handling vexing.

>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/905d6b1f-626c-459e-99b3-604b6932f082o%40googlegroups.com.

Reply via email to