4 ms·
Almost every single usage of channels in Go i've encountered was a mistake, buggy and hard to understand. To me nowadays seeing channels in use in code i just s
by mlinhares 2y ago
Almost every single usage of channels in Go i've encountered was a mistake, buggy and hard to understand. To me nowadays seeing channels in use in code i just see it as a code smell and think how difficult it would be to remove them.
There are multiple ways to use channels wrong, the compiler will not help you and most of the docs and "tutorials" will not cover that. The best thing you can do in Go is stay as far away from channels as you can.
- kccqzy 2y agoMy thought is that channels isn't bad but they are too low-level. Sometimes they are used as a queue. Sometimes they are used as a future. Indeed, channels combine features like synchronization, signaling, and data transfer. It is this versatility that makes code unreadable. The worst is when people use channels simultaneously with mutex.