6 ms·
The code is super awkward, I'm pretty sure buggy, and unfortunately illustrates that the author has only a superficial understanding of Go idioms :(
by redbad 13y ago
The code is super awkward, I'm pretty sure buggy, and unfortunately illustrates that the author has only a superficial understanding of Go idioms :(
- nolok 13y agoWithout actual example of what he does wrong and how it should be done, your post has very little value to a reader like me
- Jabbles 13y agoe.g. sync.Once() instead of init() unhelpful named return parameters didn't use range over channels
- namelezz 13y agosync.Once() instead of init(). Having the Do closed to where the channels being used makes sure we do not run into deadlock. It's a nice pattern for lazy initializing of channels and goroutine too.
- coldtea 13y agoWithout more details, this comment is not of much use than "random developer on the internet insults another's code".
- coldtea 13y agoPlus "idiomatic code" is overrated. For example idiomatic Java was a clusterfuck for nearly a decade, with all the EJB's and FactorySingletonProxies and XML everywhere. It would be better for Java programmers to ignore the idiomatic BS prevalent in the community, and just use the language in a saner way. Idiomatic is often just another name for "how lots of people prefer to do it" or "cargo cult".