5 ms·
Golang Concurrency Design Considered Harmful
- phoe-krk 9y ago'Considered Harmful' Headlines Considered Harmful I love how everyone can write a 'Considered Harmful' headline by figuring out something along the line of "I don't like it, therefore it must be bad, therefore I consider it harmful". It's time to stop. This stopped being funny months ago.
- exacube 9y ago1) using channels + goroutine to implement a map doesn't seem like the most sensible thing to do; even golang's new sync.Map type is implemented with mutexs (eg https://github.com/golang/sync/blob/master/syncmap/map.go#L267 https://github.com/golang/sync/blob/master/syncmap/map.go#L2...). Idiomatic doesn't mean ALWAYS do this no matter what; it is the natural thing to do if it feels like the right approach. 2) Don't use "considered harmful" so much; it is considered harmful.
- deleted 9y ago[deleted]
- throwaway6456 9y ago"Nobody pays me to write Erlang, so I write Go. It's terrible. I wish I was writing Erlang instead."
- numismatex 9y agoStrangely, the replies naysaying don't really back anything up here, and well, the article's on medium, written by a Go newbie, who is frustrated with . I think 'nuff said. exacube's comment below, as well as Ivan's on medium sum it up well. "Using channels in the simple cases where mutexes are just fine is a known gotcha for newcomers, discoverring Go concurrency model. But it’s well described in the official Wiki (MutexOrChannel), in the Effective Go on official Golang website, there are numeorus talks, it’s even in Go Proverbs: Channels orchestrate; mutexes serialize!"