summaryrefslogtreecommitdiff
path: root/doc/go_lang_faq.html
diff options
context:
space:
mode:
authorRob Pike <r@golang.org>2009-10-14 11:53:55 -0700
committerRob Pike <r@golang.org>2009-10-14 11:53:55 -0700
commit68c921e25cd7ed5da1ded92677b5c19960f214e5 (patch)
tree4c52f2c4900cc181ebf456a2c4647693c0e71e68 /doc/go_lang_faq.html
parentf554ef78165500ff7ac1754aad66bd4acc3381c2 (diff)
downloadgo-git-68c921e25cd7ed5da1ded92677b5c19960f214e5.tar.gz
add an entry in the lang faq about reference types.
remove a mention of sawzall in the tutorial. R=rsc DELTA=36 (14 added, 4 deleted, 18 changed) OCL=35717 CL=35719
Diffstat (limited to 'doc/go_lang_faq.html')
-rw-r--r--doc/go_lang_faq.html14
1 files changed, 14 insertions, 0 deletions
diff --git a/doc/go_lang_faq.html b/doc/go_lang_faq.html
index 5125d57696..21466437ff 100644
--- a/doc/go_lang_faq.html
+++ b/doc/go_lang_faq.html
@@ -354,6 +354,20 @@ will not invalidate any existing programs&mdash;but without a clear idea of what
equality of structs and arrays should mean, it was simpler to leave it out for now.
</p>
+<h3 id="references">
+Why are maps, slices, and channels references while arrays are values?</h3>
+<p>
+There's a lot of history on that topic. Early on, maps and channels
+were syntactically pointers and it was impossible to declare or use a
+non-pointer instance. Also, we struggled with how arrays should work.
+Eventually we decided that the strict separation of pointers and
+values made the language harder to use. Introducing reference types,
+including slices to handle the reference form of arrays, resolved
+these issues. Reference types add some regrettable complexity to the
+language but they have a large effect on usability: Go became a more
+productive, comfortable language when they were introduced.
+</p>
+
<h2 id="concurrency">Concurrency</h2>
<h3 id="csp">