News for hackers. Stuff that matters.
Re:Google’s Go has some coders raving by shurcooL on Thursday May 30, 2013 @10:24AM (#5792654)
The main reason I love Go is because it makes me feel like the more I use it, the more I'm able to do and get it done faster. When I solve a given problem, it's solved for all my current and future projects written in Go.

When I was working with C++ earlier, that was not really the case. After spending many years with it, I couldn't write a simple web server in under 5 minutes. Making something into a library had too much overhead. In Go, once I've done something [1], the next time it's one line to import it.

Also, working with the language programmatically is a pleasure. There's a full parser in the standard library.

[1] e.g. https://gist.github.com/shurcooL/5571468, https://gist.github.com/shurcooL/5504644

Re:Google’s Go has some coders raving by manuletroll on Thursday May 30, 2013 @10:59AM (#5792904)
That's very much my feeling too, it's the first time I feel like I'm really reusing a lot of my code.
Re:Google’s Go has some coders raving by swalsh on Thursday May 30, 2013 @11:01AM (#5792919)
stupid question, but from your second example what does the _ do? in this line?

"for _, "

Re:Google’s Go has some coders raving by ominous_prime on Thursday May 30, 2013 @11:07AM (#5792958)
"_" is when you must assign a value, but don't want to use it.

range in the for loop return 2 values (index, value). If you don't want the index, you can assign it to "_" to ignore it.

http://golang.org/ref/spec#Blank_identifier

Re:Google’s Go has some coders raving by swalsh on Thursday May 30, 2013 @12:07PM (#5793292)
oh! that's pretty cool.
Re:Google’s Go has some coders raving by steveklabnik on Thursday May 30, 2013 @02:32PM (#5794280)
Check your favorite language, it probably has this feature. Ruby, Haskell, tons of them.
Re:Google’s Go has some coders raving by troym on Thursday May 30, 2013 @11:06AM (#5792952)
It's the "blank identifier", a throw-away variable. See http://golang.org/ref/spec#Blank_identifier
Re:Google’s Go has some coders raving by justinhj on Thursday May 30, 2013 @11:11AM (#5792975)
For iterates over a range and returns the index and the value. If you don't use the index the underscore just ignores it.
Re:Google’s Go has some coders raving by nuttendorfer on Thursday May 30, 2013 @11:05AM (#5792941)
AFAIK the function returns to values but you only need name in this case, so _ discards that return value.