←back to thread

Go channels are bad

(www.jtolds.com)
298 points jtolds | 3 comments | | HN request time: 0.637s | source
1. dilap ◴[] No.11210911[source]
Funny timing for me -- last Friday I rewrote some code from channels to traditional sync primitives (to the code's improvement), and I was musing in my head that while everyone always says "don't communicate by sharing, share by communicating, yada yada," it doesn't seem to work out that way in practice.

I think the article is well-written, and clearly comes from a place of deep experience and understanding. Good stuff.

replies(1): >>11211900 #
2. gort ◴[] No.11211900[source]
I had a similar experience in the opposite direction. Two weeks ago I moved some code from a mutex-based design (including a map of string to mutex, which itself needed to be behind a mutex) to channels, and I love it, though the result seemed about 10% slower.

I guess the message is: everything has its place; don't make a straight-jacket for yourself.

replies(1): >>11212662 #
3. dilap ◴[] No.11212662[source]
No doubt it's quite easy to go down ratholes using mutexes and whatnot. It's a very low-level way of synchronizing.

The OPs critques of the specific design of channels as implemented by Go seem on-point to me.