-
Notifications
You must be signed in to change notification settings - Fork 0
/
golangIntro.slide
99 lines (62 loc) · 1.73 KB
/
golangIntro.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
A quick intro to Go
2014-03-05
Chris Agocs
Software engineer, Backstop Solutions
http://www.agocs.org
@agox
* What is it?
New language, has been around since 2009 (kinda)
Statically typed (kinda)
Object oriented (kinda)
Garbage collected (fully)
* What is it good at?
Quick compile times
Creating statically linked native binaries
Concurrency
* Why is it?
Next step in systems programming
Take advantage of multicore computers
Make programming fun again
* Hello World
Wooooooooooo
.play examples/hello_world.go
* Some basic syntax
.play examples/hello_world_syntax.go /START OMIT/,/END OMIT/
private String getHellos (int numHellos){...}
[[http://blog.golang.org/gos-declaration-syntax][Go's Declaration Syntax]]
[[http://c-faq.com/decl/spiral.anderson.html][the Clockwise Spiral Rule]]
* Static Typing
.play examples/static_typing2.go /START OMIT/,/END OMIT/
* Object Orientation
.play examples/object_orientation_simple.go /START OMIT/,/END OMIT/
* More Object Orientation
.play examples/object_orientation_complex.go /START OMIT/,/END OMIT/
[[http://golang.org/pkg/fmt/#Stringer][Stringer interface]]
* Compile times
Quick
* Native binaries
No runtime
Quick example
* Concurrency
Goroutines
- Really light weight, inexpensive threads
Channels
- Buffers for communication between goroutines
Select
- Selects between recieving channels
* Noroutines
.play examples/noroutines.go /START OMIT/,/END OMIT/
* Goroutines
.play examples/goroutines.go /START OMIT/,/END OMIT/
* Make programming fun again
Live example
[[https://github.com/camerazn/GolangIntro/blob/master/examples/dumbclient.go][Here's what we wrote during the session]]
* Who is using Go?
Google
Bit.ly
CloudFlare
Iron.io
SmugMug
Docker
etc., etc.