3 ms·
I think the Go docs can be more discerning about when to use channels and when to use shared memory. The broad advice of "share by communicating" is too broad,
by cle 6y ago
I think the Go docs can be more discerning about when to use channels and when to use shared memory. The broad advice of "share by communicating" is too broad, too many people learn Go and think they need to use channels and CSP everywhere, and then quickly realize that they've over-engineered their program.
I typically use shared memory by default (mostly mutexes and waitgroups), and generally only use channels when I'm working with task queues, which is where they really shine.