News for hackers. Stuff that matters.
Re:Go at Google: Language Design in the Service of Software ... by enneff on Tuesday December 04, 2012 @08:05PM (#4874312)
Re:Go at Google: Language Design in the Service of Software ... by paupino_masano on Tuesday December 04, 2012 @11:16PM (#4874838)
Excellent - thank you for that.

I'm not sure I completely agree with their reasoning: the example only really got complicated when dealing with function pointers, however that could be simplified with a macro (or a delegate in other languages).

I do agree that C can get complex to read, however I'm not sure switching the type/parameter option is the answer. But then again, I've probably become accustomed to this format. The real test will be using the language for a few weeks... I better start some small hobby projects in Go just to see if I end up liking it!

Re:Go at Google: Language Design in the Service of Software ... by enneff on Tuesday December 04, 2012 @11:40PM (#4874915)
Go doesn't have macros, as they're a whole other can of worms, so the simplification one might use in C doesn't apply to Go. :-)

Go has great support for closures, so you tend to use function types more often (or perhaps just more naturally) than in C.

It is just a matter of getting used to it. I switch back and forth between Go and other languages, and it doesn't bother me. (The thing that does get me is forgetting to use semicolons in other languages.)

Re:Go at Google: Language Design in the Service of Software ... by paupino_masano on Wednesday December 05, 2012 @12:31AM (#4875048)
Thanks again, I really appreciate your input! I'm going to have to switch between the two to get a feel for it (and like you say, get used to it). I'm a big fan for language grammars (I enjoy writing them myself) so am looking forward to digging into it some more to see how it all works :)
Re:Go at Google: Language Design in the Service of Software ... by drivebyacct2 on Tuesday December 04, 2012 @11:35PM (#4874899)

    int *i, j;
is more than a good enough reason for me. Makes interviews interesting, though: "Why are you repeatedly writing your variables and function parameters incorrectly?"
Re:Go at Google: Language Design in the Service of Software ... by paupino_masano on Wednesday December 05, 2012 @12:40AM (#4875070)
Interesting example. I'm still a newbie to Go, so would that be written as:

  var i int*
  var j int
My apologies if this seems like a simple question: I haven't played with the language enough to know :)

[EDIT: Sorry, I didn't realize how to format code!]

Re:Go at Google: Language Design in the Service of Software ... by Jabbles on Wednesday December 05, 2012 @05:19AM (#4875671)
The asterisk goes before the type for pointers:

    var i *int
Unlike C, values are always initialized in Go.

http://play.golang.org/p/8tAzKyES2I