Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2285)

Delta Between Two Patch Sets: doc/go_lang_faq.html

Issue 824045: code review 824045: Language FAQ: update the entry on exceptions. (Closed)
Left Patch Set: code review 824045: Language FAQ: update the entry on exceptions. Created 14 years, 12 months ago
Right Patch Set: code review 824045: Language FAQ: update the entry on exceptions. Created 14 years, 12 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 <!-- Language Design FAQ --> 1 <!-- Language Design FAQ -->
2 2
3 <h2 id="origins">Origins</h2> 3 <h2 id="origins">Origins</h2>
4 4
5 <h3 id="history"> 5 <h3 id="history">
6 What is the history of the project?</h3> 6 What is the history of the project?</h3>
7 <p> 7 <p>
8 Robert Griesemer, Rob Pike and Ken Thompson started sketching the 8 Robert Griesemer, Rob Pike and Ken Thompson started sketching the
9 goals for a new language on the white board on September 21, 2007. 9 goals for a new language on the white board on September 21, 2007.
10 Within a few days the goals had settled into a plan to do something 10 Within a few days the goals had settled into a plan to do something
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 (with explicit unboxing) mean in many cases it is possible to write 275 (with explicit unboxing) mean in many cases it is possible to write
276 code that does what generics would enable, if less smoothly. 276 code that does what generics would enable, if less smoothly.
277 </p> 277 </p>
278 <p> 278 <p>
279 This remains an open issue. 279 This remains an open issue.
280 </p> 280 </p>
281 281
282 <h3 id="exceptions"> 282 <h3 id="exceptions">
283 Why does Go not have exceptions?</h3> 283 Why does Go not have exceptions?</h3>
284 <p> 284 <p>
285 We believe that coupling the usual idea of exceptions to a control 285 We believe that coupling the usual idea of exceptions to a control
iant 2010/04/07 23:02:33 I think you can omit "the usual idea of".
286 structure, as in the <code>try-catch-finally</code> idiom, results in 286 structure, as in the <code>try-catch-finally</code> idiom, results in
287 convoluted code. It also tends to encourage programmers to label 287 convoluted code. It also tends to encourage programmers to label
288 too many ordinary errors, such as failing to open a file, as 288 too many ordinary errors, such as failing to open a file, as
289 exceptional. And then the type system gets mixed in. 289 exceptional. And then the type system gets mixed in.
iant 2010/04/07 23:02:33 I think I know what you mean by the type system co
290 </p> 290 </p>
291 <p> 291 <p>
292 Go takes a different approach. Instead of exceptions, it has couple 292 Go takes a different approach. Instead of exceptions, it has couple
iant 2010/04/07 23:02:33 s/has couple/has a couple/
293 of built-in functions to signal and recover from truly exceptional 293 of built-in functions to signal and recover from truly exceptional
294 conditions. The recovery mechanism is executed only as part of a 294 conditions. The recovery mechanism is executed only as part of a
295 function's state being torn down after an error, which is sufficient 295 function's state being torn down after an error, which is sufficient
296 to handle catastrophe but awkward enough to discourage overuse. 296 to handle catastrophe but requires no extra control structures and,
iant 2010/04/07 23:02:33 Maybe s/awkward enough to discourage overuse/avoid
297 when used well, can result in clean error-handling code.
297 </p> 298 </p>
298 299
299 <h3 id="assertions"> 300 <h3 id="assertions">
300 Why does Go not have assertions?</h3> 301 Why does Go not have assertions?</h3>
301 <p> 302 <p>
302 This is answered in the general <a href="go_faq.html#Where_is_assert">FAQ</a>. 303 This is answered in the general <a href="go_faq.html#Where_is_assert">FAQ</a>.
303 </p> 304 </p>
304 305
305 <h2 id="types">Types</h2> 306 <h2 id="types">Types</h2>
306 307
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 synchronized. Therefore requiring that all map operations grab a mutex would sl ow 482 synchronized. Therefore requiring that all map operations grab a mutex would sl ow
482 down most programs and add safety to few. This was not an easy decision, 483 down most programs and add safety to few. This was not an easy decision,
483 however, since it means uncontrolled map access can crash the program. 484 however, since it means uncontrolled map access can crash the program.
484 </p> 485 </p>
485 486
486 <p> 487 <p>
487 The language does not preclude atomic map updates. When required, such 488 The language does not preclude atomic map updates. When required, such
488 as when hosting an untrusted program, the implementation could interlock 489 as when hosting an untrusted program, the implementation could interlock
489 map access. 490 map access.
490 </p> 491 </p>
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b