Re:“Go’s design is a disservice to intelligent programmers”
by nemo1618 on Wednesday March 25, 2015 @06:26PM
(#9266433)
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_
[ Parent
| on HN ]
Re:“Go’s design is a disservice to intelligent programmers”
by Cthulhu_ on Wednesday March 25, 2015 @06:36PM
(#9266492)
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.
Re:“Go’s design is a disservice to intelligent programmers”
by QuercusMax on Wednesday March 25, 2015 @06:30PM
(#9266451)
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.
Re:“Go’s design is a disservice to intelligent programmers”
by zoips on Wednesday March 25, 2015 @06:44PM
(#9266537)
Kind of code golfing it: http://play.golang.org/p/s53zQrE0ei
Re:“Go’s design is a disservice to intelligent programmers”
by sounds on Wednesday March 25, 2015 @07:10PM
(#9266690)
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.)
Re:“Go’s design is a disservice to intelligent programmers”
by NateDad on Wednesday March 25, 2015 @09:44PM
(#9267323)
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.
Re:“Go’s design is a disservice to intelligent programmers”
by NateDad on Wednesday March 25, 2015 @06:46PM
(#9266549)
Yep, that's what I would have written.
Re:“Go’s design is a disservice to intelligent programmers”
by he_the_great on Thursday March 26, 2015 @08:09PM
(#9274007)
What happens when copy fails? Don't worry I already know.