Live data from Hacker News

First chapter of Kernighan and Donovan's new Go book [pdf]

gopl.io

11–20 of 233 posts

Re: First chapter of Kernighan and Donovan's new Go book [pdf]

#11

Question for the Go experts out there: does it make sense to buy this book to learn Go or are there better tutorials/books?

This book hasn't come out yet. Without having read it, I'd probably recommend it when it does, but for the time being, the online Go tutorial[0] is a great introduction.

[0] https://tour.golang.org

Re: First chapter of Kernighan and Donovan's new Go book [pdf]

#14

To those in the Go community: - What is Go well suited for other than network programming? - Why might one decide to write the backend API of their web app in Go, compared to say Grails, Python etc.

> What is Go well suited for other than network programming? Why might one decide to write the backend API of their web app in Go, compared to say Grails, Python etc.

You'll get a lot of different opinions on this. I'll just speak based on my experience, since Python was my primary language before coming to Go.

Everything I used to use Python for, I can do faster in Go. The notable exception to this is statistical analysis, as Go does not have any FORTRAN bindings[0], whereas Python does (through Numpy & co.). I still use a combination of Python, R, and other languages for this.

I came to Go for the static typing and native concurrency[1], but I stayed because I'm more productive in it. Python and Go are about equally fun to write, but because I can build things much faster in Go, it ends up feeling more rewarding overall, given that my time is limited.

If you don't really have a pressing need for anything else, you can stick with Python. But I found Python to be slow to develop in and cumbersome, and after trying Go out, I realized I was 100x more productive in it.

[0] apparently this may no longer be true; if so, that's exciting news!

[1] this was also before Python had built-in async. I still prefer Go's concurrency model and syntax, but at least Python has this as an option now.

Re: First chapter of Kernighan and Donovan's new Go book [pdf]

#15

To those in the Go community: - What is Go well suited for other than network programming? - Why might one decide to write the backend API of their web app in Go, compared to say Grails, Python etc.

Other than some quite significant performance gains, I'd say the main upside for the case of a backend API would be channels. Concurrency is dead simple in Go - and if you want to do 5 different requests to ElasticSearch in parallel and merge the results when all of them are finished (like we do for Universal Search), that's just a few lines of very readable Go. Try that with a GIL, sure, multithreaded Python and Ruby is possible, but it's not for the faint hearted and not as easy to read.

Moreover, I love static deploys and cross compilation with Go. Compile your app (even to Windows!), copy it to a server, simply run it as a single binary. No dependency management, no apt-get & easy_install & pip, it just runs.

Re: First chapter of Kernighan and Donovan's new Go book [pdf]

#16

Question for the Go experts out there: does it make sense to buy this book to learn Go or are there better tutorials/books?

Effective Go is a great intro: https://golang.org/doc/effective_go.html

Also, check out the blog posts for more information on specific topics: http://blog.golang.org/. They are really well written.

Re: First chapter of Kernighan and Donovan's new Go book [pdf]

#17

Question for the Go experts out there: does it make sense to buy this book to learn Go or are there better tutorials/books?

You can easily learn go by going through all the pages under "Learning Go" here: https://golang.org/doc/ and probably some practice projects. This book might be a good alternative but we can't know yet.

Re: First chapter of Kernighan and Donovan's new Go book [pdf]

#18

Question for the Go experts out there: does it make sense to buy this book to learn Go or are there better tutorials/books?

I found "Go Blueprints" a good introduction for someone who wants to get into practical projects quickly, and doesn't need an introduction to programming. If I were to write a book about Go it would be exactly that, demonstrating how useful Go can be for day to day tasks, and for cli tools and servers.

Re: First chapter of Kernighan and Donovan's new Go book [pdf]

#19

To those in the Go community: - What is Go well suited for other than network programming? - Why might one decide to write the backend API of their web app in Go, compared to say Grails, Python etc.

I've used Go for neural networks and machine learning with great success. Fast, safe, fairly straightforward. Much easier to parallelize than with Python.
Post reply on HN