2 ms·
> fixing the data races. Go handles both of this for you from the start. In what sense does Go handle (prevent) data races for the programmer? In my experienc
by pgwhalen 4y ago
> fixing the data races. Go handles both of this for you from the start.
In what sense does Go handle (prevent) data races for the programmer?
In my experience (which is not _extensive_ but certainly non-trivial), Go programmers deal with all the same problems of shared mutable state that programmers of concurrent code in other languages deal with. Sure, mantras like "Don't communicate by sharing memory; share memory by communicating" are wise, but it's just a mantra, not anything the language provides for you. A skilled concurrent programmer will write code in this manner regardless of the language, and Go doesn't provide a ton as far as enforcing this.
Sure, you _could_ write your go program without any shared mutable state, but that gets convoluted fast.