Go does have some nice, clean resources, provided by the core language group and users. I find golang.org to be quite helpful. If you're interested in learning Go, I suggest Go's A Tour of Go to start: http://tour.golang.org/welcome/1
How novice? You could try out the Go Tour [1.]; it's gradual and if you find yourself getting stuck, you can break and definitely use Google to find help.
The Tour is a great place to start. It's a good idea to complement the basics you learn there with the common gotchas. "50 Shades of Go" covers most of the major gotchas.
I didn't love it. I found it a little inconsistent, and I didn't learn that much from it; most of the Go blog posts have more insight than the book does.
It's a fine introduction to the language! It's great that Go has a credible book. But if you're already familiar with Go, I think you can skip this.
Happy to hear if other readers had different experiences.
+1. Excellent book. Nice pragmatic examples that not only showcase Go's features but are also interesting from the purely algorithmic angle covering pretty decent range from bit-twiddling to some rather involved math (by my standards of course).
That's why there's a voting system, if people are interested, it gets to the front page :-)
For me, I haven't worked with Go before so it's nice to see a resource like this as it's appealing as an outsider. Maybe it's the thing that pushes people from just hearing about something to actually try it out themselves.
OP must be new to Go if he does not knows this website already. And the argument that people use in other submissions to justify a re-post or apparently irrelevant submissions does not works here because if you search "Go Examples" [1] in most web crawlers will return this website among the first results.
Everyone who at least couple of times googled for anything Go related knows this site. Should I post golang.org now, because there may be someone living under a rock?
I've been programming in Go for a few years now and I've never seen this site before.
It's quite possible that the specific search terms you use (eg I never include "example" when Googling about Go[1]) and Google's personalisation (eg favouring resources you've used previously) would result in different search results to what other people might receive.
[1] Since any resource offering help in programming will include example source code, I always considered the search term "example" to be redundant.
Result #5 on a query that generic is quite far down when you consider that all of the top 4 results would equally answer the question. So many people might not get as far as gobyexample.com using your search term example.
Plus on queries that generic, a lot of people might just go straight to golang.org and re-read their docs.
Obviously this isn't the case for everyone, but it would explain why I've personally never heard of gobyexample.com before.
I started keeping personal one page notes on Github for languages I want to learn so that it's easier to be effective when I start a small project. Here are my Go notes:
That depends a lot on what you mean by "complex". If your problem naturally and profitably decomposes into a pipeline of smaller, simple subproblems, Go can still be pretty nice to work with.
I wrote a (bad) compiler in it, and Go wasn't really any of the trouble I had with it.
I think "simple" in that context means that the software should be as simple as the problem domain will allow, not necessarily that it's bad at building applications with complex needs.
Giving your team more powerful tools should always be a positive. If you don't trust them not to do harmful things with them then you have bigger problems.
It doesn't feel like that's a strategy that worked especially well for Scala or C++. Go isn't the only language that removes powerful tools: all the strict functional languages do too!
The issues that Scala and C++ have are far beyond just "having generics". Classical (ML-style) generics are an incredibly simple feature, much more so than, say, built-in channels.
I'd say typeclasses, templates, and variance have, sure. Those are separate features from generics in my mind. (But you could reasonably lump them all together under the heading of "generics" and I won't argue too much.) :)
If you read my comment carefully, you'll see that I was not in fact saying that people were wrong to like Scala. I like C, but I don't get irritated when people point out its innumerable flaws.
If you read my comment carefully, you'll see that I was not in fact saying that you were saying that people were wrong to like Scala. I think it's the best language available today and I think that's as a direct result of it being willing to put powerful tools in the hands of its users; therefore "It doesn't feel like that's a strategy that worked especially well for Scala" is, in my view, simply wrong.
Note that clicking the tiny gopher icon in the upper right of the code box will launch play.golang.org with that code. That's a good way to play with code and see results in your browser.
Edit: no, seriously, as the other commenter mentions: "This site is well known and I have been using it as reference for a long time." If looking for something like this, it would've been hard to avoid this. This post seems sponsored, or friends doing favours. Weird.
You're not going to win this fight. Content makes it the the front page of HN (and Reddit and other user-generated content sites) by getting upvotes. You just have to accept that you may see content that isn't new to you. If it is on the front page, that means enough people haven't seen it yet.
Edit: I have already seen the website as well, but I was glad to see it again because I could come to the comments section for some good discussion.
Great resource for beginners. Though I've noticed a trend when trying to familiarize myself with languages and Golang in particular: examples tend to be too simple and I've found myself struggling once I tried to create more "real-life" things with it (similar to hello world or server examples on Node.js).
Though this is most likely personal/anecdotal and the website is an invaluable resource for a beginner. Well done.
I highly recommend this book. I find it the best Go book out there right now. Manning's "Go in Action" isn't nearly as good as Donovan & Kernighan's work.
One of the things I absolutely love about Go is that the standard library is so readable and accessible. It's been a great resource for learning by example, especially for some fairly complex design patterns.
Agreed. I feel like the struggling when actually implementing the language for a real project/product is normal.
I think this is because programming languages are built with performance, readability, and writability in mind. I've yet to come across a programming language that was specifically built to make it easy to use to build a software product (plenty of frameworks though, ex Rails).
This is awesome! Thank you. This is especially helpful for programmers who are good at other languages and want to get a feel of go quickly over a weekend. Much easier to map the existing mental models built over-time to the new go programming semantics. Humans learn best by example and comparing the new stuff with what we already know.
I agree 100%. I had a similar desire, that is to get a feel for go without making a big time commitment. I went to the wikipedia page and read that it has something called channels that sounded kind of like FIFOs or perhaps something out of SystemC.
This page gives a much faster understanding of what the language is like.
This is a really nice resource and I've been wanting to look at Go for a while! Could anybody point at the sort of projects that the goroutine/channel infrastructure excels at in particular?
You can use goroutine ( call function prefixed with 'go' e.g. go foo() ) or channels, any where where you would use threads in languages like C/C++/Java.
Their terminology is concurrent programming. So you never actually spawn threads. But just declare your code to be able to run concurrently. So it will parallel process on multi cpu machine. Or just get scheduled in/out of cpu, when waiting for I/O. So very much like threads, but the mental/programming model is different.
Channels are particularly very useful, where you would use a thing like Barrier in Java, for threads to converge. In channels you get concurrency by message passing on channels.
So example application can be, crawl multiple sites concurrently and converge using channels.
In my experience its very robust, and once coded and tested, rarely(if at all) you face any weird bugs, e.g. Deadlocks/etc which you would, in explicit threaded programming. Not to imply that its not shoot-in-the-foot proof. But for a programmer having experience of multi-threaded programming, when one moves to this model, it seems more intuitive and robust.
Edit: I see other programmers have endorsed http://tour.golang.org/welcome/1 . I second/third them. IMHO that's the best resource to learn Go (and from your browser). After I did the 70 or thereabouts exercises, over there, I attained Nirvana :-) , and didn't need anything else. Of course apart from golang pkg docs. And one piece which confused me in the beginning was slice/array. Its very easy, once you get a hang of it. Another thumb rule I follow is always have pointers to struct in slices or maps. To avoid, the costly copy. May be its obvious in hindsight, but wasn't to me, in the beginning, as sometimes passed pointer to slice, having struct as values, to a function argument. On realizing what a foolish thing it was, as slice/maps are passed by reference, I started doing the reverse (i.e. slice as is, but having pointers to structs) :-).
I clicked expecting a go-the-board-game learning site.
I think I need to learn the rudiments of go-the-programming-language, just so I stop forgetting there's still something to disambiguate when I see the word 'Go' as a noun.
There is a previous discussion of Go by Example if you want to mine the comments: https://news.ycombinator.com/item?id=7075515
There is also Effective Go for learning about, well, idiomatic Go: https://golang.org/doc/effective_go.html
And there is a previous discussion of Effective Go if you want to mine the comments: https://news.ycombinator.com/item?id=4285461