News for hackers. Stuff that matters.
Re:Migrated WordGap from Python to Go 1 by earthboundkid on Saturday March 23, 2013 @10:42PM (#5430849)
> Also tuples.

A tuple is just a makeshift struct. Think about it this way: by replacing it with a real struct, you're documenting your code.

Re:Migrated WordGap from Python to Go 1 by derefr on Saturday March 23, 2013 @11:45PM (#5431009)
Imagine if every function was only allowed to take a single parameter--and in order to write a function that takes multiple, what you really had to do was declare a struct of type "the set of parameters foo() takes" and then construct one whenever you called foo().

This is what it feels like going from a language with tuples, to one without :)

(I would also say "imagine further that you had to do the same whenever you returned multiple values"--but you don't have to imagine ;)

Re:Migrated WordGap from Python to Go 1 by Evbn on Sunday March 24, 2013 @02:15AM (#5431320)
Go has tuple return values and of course input values.

The only thing missing is giving a tuples a name. But if you do that, you should make a struct, or you will forget which field is which and have bugs.