Loading [MathJax]/jax/output/HTML-CSS/fonts/TeX/fontdata.js

Go

7 thoughts
last posted Feb. 5, 2015, 2:54 p.m.
1
get stream as: markdown or atom
0

I have been using Go more seriously recently. I am extremely impressed with the language.

0

I haven't used a statically typed language for anything serious in the past. Most of my experience has been with Python (a dynamically typed language.)

I am beginning to see the benefits of a statically typed language. Especially as the system grows. Type checking is extremely useful and starting to wish it was there in Python.

The more I think back to many of the bugs fixed in my Python web applications I realize they would be non-existent in Go.

0

What impresses me the most are I/O streams, networking support and goroutines. The combination of those three things is absolutely mind blowing.

0

Go's func keyword was originally function. During a meeting with Larry Page and Sergey Brin, Larry said it should be func.

Source: Rob Pike during his keynote at GopherCon 2014

0

A perfect example of how lovely Go can be:

http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
var handler http.Handler
select {
case <-(func() <-chan struct{} {
ch := make(chan struct{})
go func() {
time.Sleep(6 * time.Second)
close(ch)
}()
return ch
})():
handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
w.Write([]byte("hello world"))
})
case <-time.After(5 * time.Second):
handler = UserTemplateResponse(http.StatusGatewayTimeout, ci)
}
handler.ServeHTTP(w, r)
})
view raw gistfile1.go hosted with ❤ by GitHub

This code is from Gondor's router during spin (being ported from original Python so not complete yet.)

0

One of the most powerful aspects to Go are its interfaces. See http://talks.golang.org/2015/json.slide for some mind blowing ideas for JSON decoding.