forked from RedHatOfficial/GoCourse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
go_worth_learning.slide
226 lines (142 loc) · 5.16 KB
/
go_worth_learning.slide
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
Is Go language actually worth learning?
Red Hat
14 Apr 2021
Tags: golang, go
Pavel Tišnovský <[email protected]>
Red Hat, Inc.
* Introduction
There are lots of interesting programming languages that you can learn.
The question is, should you perfect them all? The answer is no, of course.
So what about the Go language - is it worth try?
In this presentation we are going to talk about Go's pros (goroutines,
channels, GC, type systems) and cons (a language with attributes taken from the
previous century :)
* Gophers
#The Go gopher was designed by Renee French. (http://reneefrench.blogspot.com/)
#Source https://golang.org/doc/gopher/fiveyears.jpg
#The design and this image is licensed under the Creative Commons 3.0 Attributions license.
.image ./common/fiveyears.jpg _ 900
* Introduction
- Launched in November 2009 by Google
- Rob Pike, Ken Thompson, Robert Griesemer
- More readable replacement for C/C++/Java/...
- „Less is more“
* Introduction
- compiled
- statically typed
- garbage collected
- built-in concurrency
- strict formatting rules
- server-side web (PHP, Node.js, Python, Ruby, Java)
- cloud technologies (Docker, Podman, Kubernetes, Kubernetes Operators, MinIO, ...)
- available for all interesting systems
- and most architectures (x86-64, ARMv6, ARMv8, even s390x and PowerPC64 LE)
- custom back end + cgo
* Cloud technologies
.link https://www.docker.com/ Docker
.link https://podman.io/ Podman
.link https://kubernetes.io/ Kubernetes
.link https://coreos.com/operators/ Kubernetes Operators
.link https://min.io/ MinIO
.link https://nsq.io/ NSQ
* Goals
- simplicity
- unambiguity
- performance
- pragmatic
- safer applications (compared to C/C++)
- microservices
- ease to install ("DLL hell" can't happen)
- for DevOps from DevOps
- fast builds (CI tools like it ;-)
* Attention
- Go is a blend of modern approaches combined with quite old ideas
- error handling
- no generics
- no templates
- no class-based OOP
- no `try`/`catch`/`finally`
- `goto` keyword
- `nil` identifier
* Interfaces are automatically implemented
.image ./images/interface.jpg
* Go vs C(++)
- stronger type system
- no text substitution macros
- no header files
- package system + checks
- safer memory operations + GC
- standardized framework for tests
- stricter rules (`++`/`--`, pointers, ...)
- no exception handling control structures (yet?)
- no generic data types (yet?)
* But... we are in 21th century!
.image ./images/ural.jpg _ 700
* But... we are in 21th century!
- Multi-core CPUs
- Distributed systems
- Memory locality
- Readability
* Multi-core CPUs
.image ./images/perf.png
* Multi-core CPUs
.image ./images/Amdahl.png
* Support for concurrency
- Communicating sequential processes (a formal language etc. etc.)
- "Don't communicate by sharing memory; share memory by communicating"
- So called _goroutines_
- Channels
* Goroutines + channels is a way to ... Go
- Deadlocks are not such a big problem then
.image ./images/deadlock.jpg _ 700
* Memory locality
- True structures
- True value types
- No object headers
- Java: no value types, no structures, object headers
* Dynamic devel teams
.image ./images/teams.png
* Dynamic devel teams
- stability
- on source code level: if it compiles in version X, it will compile in version X+1 too
- OTOH: https://pythonclock.org/
- readability
* go-fmt
- Gofmt’s style is no one’s favorite, yet gofmt is everyone’s favorite. — Rob Pike
- standard tool
* Wanna be mainstream?
- [[http://pypl.github.io/PYPL.html]]
- [[https://hackernoon.com/10-best-programming-languages-to-learn-in-2019-e5b05af4a972]]
- [[https://insights.dice.com/2018/12/17/5-programming-languages-consider-learning-2019/]]
- [[https://www.rankred.com/new-programming-languages-to-learn/]]
* Popularity
- [[https://insights.stackoverflow.com/survey/2020#technology-most-loved-dreaded-and-wanted-languages-loved]]
- [[https://insights.stackoverflow.com/survey/2020#technology-most-loved-dreaded-and-wanted-languages-dreaded]]
- [[https://insights.stackoverflow.com/survey/2020#technology-most-loved-dreaded-and-wanted-languages-wanted]]
* Popularity chart
.image ./images/popularity.png _ 600
* So...is it worth to spend time learning Go?
- networking - YES
- (micro)services - YES
- scalable systems - YES
- you like strict formatting rules - YES
- you like strong type systems - YES
- you like minimalism - YES
- pretty fast compilation - YES
- the simplest deployment - YES
- guaranteed source code compatibility - YES
* So...is it worth to spend time learning Go?
- you like classic (broken) class-bases OOP - NO
- you like baroque languages - NO, enjoy C++
- you like inconsistent languages - NO, enjoy Perl
- you like homoiconic languages - NO, LISP/Scheme/Clojure are better then
- you want to manage memory ourself - NO
- you like to have buffer overflows - NO, there are "better" choices
- you like really very strong type system & fast language - Rust
#last slide
* More Gophers
#The Go gopher was designed by Renee French. (http://reneefrench.blogspot.com/)
#Source https://golang.org/doc/gopher/bumper.png
#The design and this image is licensed under the Creative Commons 3.0 Attributions license.
.image ./images/bumper.png _ 900
# finito