Google 遇到的問題
⼤量的 C++ 代码,同時引入 Java 和 Pytho
n
成千上萬的⼯程师 (每個⼈風格不同
)
數百萬的程式碼 (如何減少代碼產量
)
分散式編譯系統 (交叉編譯速度 …
)
數百萬的伺服器 (部署時間 …)
Slide 17
Slide 17 text
Go 語⾔特性
沒有物件導向 (無繼承特性
)
強制類型
Function 和 Metho
d
没有錯誤處理
⽤字⾸來區別可否存取
不⽤的 Import 或變數會引起編譯錯誤
完整的標準函式
⽀援 UTF-8 格式
Slide 18
Slide 18 text
沒有物件導向 (無繼承特性)
Slide 19
Slide 19 text
強制類型
Slide 20
Slide 20 text
Function 和 Method
Slide 21
Slide 21 text
没有錯誤處理
Slide 22
Slide 22 text
⽤字⾸來區別可否存取
Slide 23
Slide 23 text
Import 錯誤
Slide 24
Slide 24 text
Go at Google: Language Design
in the Service of Software
Engineering
https://talks.golang.org/2012/splash.article
Slide 25
Slide 25 text
Go 優勢
學習曲線
開發及執⾏效率
由 Google 維護
部署⽅便
跨平台編譯
內建 Coding Style, Testing 等⼯具
多核⼼處理
Slide 26
Slide 26 text
誰在⽤ Go 語⾔
Slide 27
Slide 27 text
No content
Slide 28
Slide 28 text
Go ⼤型專案
https://github.com/golang/go/wiki/Projects
Slide 29
Slide 29 text
No content
Slide 30
Slide 30 text
No content
Slide 31
Slide 31 text
No content
Slide 32
Slide 32 text
No content
Slide 33
Slide 33 text
No content
Slide 34
Slide 34 text
No content
Slide 35
Slide 35 text
No content
Slide 36
Slide 36 text
No content
Slide 37
Slide 37 text
No content
Slide 38
Slide 38 text
No content
Slide 39
Slide 39 text
No content
Slide 40
Slide 40 text
Why Go
https://github.com/golang/go/wiki/whygo
Slide 41
Slide 41 text
Switched from other languages.
PHP, Python, Node.js, Java, C++
https://github.com/golang/go/wiki/FromXToGo
Slide 42
Slide 42 text
5 Reasons Why We switched from Python To Go
https://hackernoon.com/5-reasons-why-we-switched-from-python-to-go-4414d5f42690
中⽂: https://blog.wu-boy.com/2017/04/5-reasons-why-we-switched-from-python-to-go/
Slide 43
Slide 43 text
From Python to Go: migrating our entire API
https://blog.repustate.com/migrating-entire-api-go-python/
Slide 44
Slide 44 text
Farewell Node.js
T
J
https://goo.gl/WVxwtb
44
Slide 45
Slide 45 text
如何將 Go 語⾔導入團隊
Slide 46
Slide 46 text
學習曲線
程式碼簡潔
沒有物件導向
團隊開發⼯具整合
Coding Style
Testing Tool
Benchmark Too
l
部署環境 (Go 1.5 Cross Compiler
)
降低部署時間
降低測試時間
重啟時間非常快,Load-Balancer 不需要 Pre-warning
系統效能 (記憶體⽤量, CPU 使⽤率 …
)
EC2 使⽤量降低 (降低 80 ~ 85%)
Response time 100ms -> 10ms