3 ms·
Whever I tried to use channels I regretted it at the end. I believe the channels in Go are the worst part of the language. I use mutexes.
by eknkc 5y ago
Whever I tried to use channels I regretted it at the end. I believe the channels in Go are the worst part of the language.
I use mutexes.
- tapirl 5y agoHow could it be? Programming with channels is not only intuitive but fun for many cases: https://go101.org/article/channel-use-cases.html https://go101.org/article/channel-use-cases.html Yes, channels are not always best solutions for any case. There are cases mutexes are more suitable. Just choose the best solution for specified cases. Always sticking to one is not a good attitude.
- jeffreybolle 5y agoI agree with this. We used to do a coding exercise at a previous job that was really well suited to mutexes and whenever someone tried to use channels they ended up with a much more complex solution. Equally, there are lots of cases which lend themselves to channels really well. Waiting on multiple things at once is hard to without channels and select for example.
- nemo1618 5y agoI agree (well, maybe not the worst, but certainly one of the worst), but in retrospect it's hard to say whether Go would have taken off the way it did, had it not pushed the concurrency angle so hard. I think Go's focus on software engineering (as well as its "stubbornness" in general) is far more valuable than its concurrency features, but there's no question the latter is more exciting and likely to drive growth.