Hacker News new | ask | show | jobs
by XBigTK13X 4786 days ago
What are some common gotchas I should be wary of if I want to try out Go? I haven't touched the language since I first heard about it, due to an issue that has been left unfixed for almost three years.

https://code.google.com/p/go/issues/detail?id=909

Here is a C# example of what I'm looking for:

LINQ brings brevity and clarity to complicated collection operations. However, if you rely on it in performance-critical applications, then you will find that it causes enough garbage collection overhead to slow your app to a crawl.

1 comments

From what I know on the topic issue #909 only ever had a realistic chance of affecting 32-bit users. And from the looks of it, they've made the GC in Go 1.1 more precise, so hopefully the incidence of those problems on 32 bit goes down even more.

I use Go exclusively on 64 bit and have never had that problem. This includes Go programs that use 64GB+ of memory that can run for days. I also use other long running Go programs (a web site and an X window manager) and haven't run into problems.

> What are some common gotchas I should be wary of if I want to try out Go?

The most common complaint people have is that Go doesn't have "generics" like that found in most other statically typed languages (e.g., parametric polymorphism or ad-hoc polymorphism). You can still get a lot of code reuse through Go's flavor of polymorphism (structural sub-typing), but it requires a little brain rewiring---and that puts some folks off.