4. 主要目标
Bruce Eckel 表示:
C++的复杂性(新C++更复杂),对于生产效率的影响,已经不
再合理了。程序员为了使用好C++, 需要跳过很多坑,是完全说不
通的,只是浪费你的时间和精力。现在,go对C++想要解决的那类
问题,做的更合理。
( Bruce Eckel: The complexity of C++ (even more complexity has been added
in the new C++), and the resulting impact on productivity, is no longer justified. All
the hoops that the C++ programmer had to jump through in order to use a C-
compatible language make no sense anymore -- they‗re just a waste of time and
effort. Now, Go makes much more sense for the class of problems that C++ was
originally intended to solve.)
11. 关键字
共25个关键词(ANSI C语言32 个,C++ 63个,Lua 20个,Java50个)
GO语言在关键词使用上是非常吝啬的。
Keep it simple, make it general, and make it intelligible.
--- Douglas McIlroy
break default func interface select
case defer go map struct
chan else goto package switch
const fallthrough if range type
continue for import return var
24. 名字空间和类 VS. 目录
1. 一个目录中的所有文件同属一个namespace (朴素思想来源?)
2. 同一目录、不同文件的变量,函数,互相可见,因此也类似于
Class
3. 小写字母开头的为private函数/变量
func test() var a 对其他目录不可见
4. 大写字母开头的为public函数/变量
func Test() var A 对其他目录可见
50. 通信顺序进程(CSP)
CSP := Communication Sequential Processing
is a formal language for describing patterns of interaction in concurrent systems.
一种用于定义并行交互的形式语言.
eg: COPY = *[c:character; west?c → east!c]
CSP was first described in a 1978 paper by C. A. R. Hoare(東尼·霍爾)
• 1980年,获颁图灵奖。
• 1982年,成为英国皇家学会院士。
• 2000年,因为他在计算机科学与教育方面的杰出贡献,获得英国王室颁赠爵士头衔。
(思考:霍爾还做过什么算法?)