zlacker

[parent] [thread] 7 comments
1. nemo16+(OP)[view] [source] 2015-03-25 22:26:19
IMO, the author's "copy data to stdout" example betrays a lack of language understanding. Here's a more idiomatic version: http://play.golang.org/p/ZWatRuj3Q_
replies(5): >>Quercu+i >>Cthulh+X >>zoips+G1 >>NateDa+S1 >>he_the+aY1
2. Quercu+i[view] [source] 2015-03-25 22:30:14
>>nemo16+(OP)
Thanks! I'm just learning go (started last night), but I couldn't believe there wasn't a better way. It felt like a straw man example.
3. Cthulh+X[view] [source] 2015-03-25 22:36:56
>>nemo16+(OP)
Plus given Go's focus on external dependencies, a common task like reading commandline parameters can (and should) be done with a library that solved that problem for you already - don't reinvent the wheel, and such.
4. zoips+G1[view] [source] 2015-03-25 22:44:36
>>nemo16+(OP)
Kind of code golfing it: http://play.golang.org/p/s53zQrE0ei
replies(1): >>sounds+94
5. NateDa+S1[view] [source] 2015-03-25 22:46:35
>>nemo16+(OP)
Yep, that's what I would have written.
◧◩
6. sounds+94[view] [source] [discussion] 2015-03-25 23:10:39
>>zoips+G1
That's definitely shorter, but I would hope that isn't considered the most shining example of non-obfuscated code. :)

(For code golf, though, it's just fine.)

replies(1): >>NateDa+me
◧◩◪
7. NateDa+me[view] [source] [discussion] 2015-03-26 01:44:54
>>sounds+94
It's actually very simple code, if you're at all familiar with go. That's probably what I would have written just by sitting down at the computer to do so for work.
8. he_the+aY1[view] [source] 2015-03-27 00:09:44
>>nemo16+(OP)
What happens when copy fails? Don't worry I already know.
[go to top]