Commit a3db32d2 authored by Rob Pike's avatar Rob Pike

Language FAQ: editing tweaks after iant.

R=iant
CC=golang-dev
https://golang.org/cl/874043
parent 956926ee
...@@ -282,14 +282,14 @@ This remains an open issue. ...@@ -282,14 +282,14 @@ This remains an open issue.
<h3 id="exceptions"> <h3 id="exceptions">
Why does Go not have exceptions?</h3> Why does Go not have exceptions?</h3>
<p> <p>
We believe that coupling the usual idea of exceptions to a control We believe that coupling exceptions to a control
structure, as in the <code>try-catch-finally</code> idiom, results in structure, as in the <code>try-catch-finally</code> idiom, results in
convoluted code. It also tends to encourage programmers to label convoluted code. It also tends to encourage programmers to label
too many ordinary errors, such as failing to open a file, as too many ordinary errors, such as failing to open a file, as
exceptional. And then the type system gets mixed in. exceptional.
</p> </p>
<p> <p>
Go takes a different approach. Instead of exceptions, it has couple Go takes a different approach. Instead of exceptions, it has a couple
of built-in functions to signal and recover from truly exceptional of built-in functions to signal and recover from truly exceptional
conditions. The recovery mechanism is executed only as part of a conditions. The recovery mechanism is executed only as part of a
function's state being torn down after an error, which is sufficient function's state being torn down after an error, which is sufficient
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment