Re:The Tao of Go
by arianvanp on Wednesday February 12, 2025 @05:17AM
(#43023843)
> We accept interface values, as the Go proverb says, so that we need make the fewest assumptions about what they are, but we return concrete values (structs), which save users from writing lots of type assertions about them.
I wish go people actually did this. Also it's just not true. The standard library is full of private structs that are returned as interfaces. Just look at the net library for example. Non of the listener structs are exposed. Only the net.Listener interface
And of course the biggest offender is error which is an interface and the return value of basically every function. And you're basically writing type assertions all day
Re:The Tao of Go
by valbaca on Wednesday February 12, 2025 @02:05PM
(#43028572)
"define Tao"
> (in Chinese philosophy) the absolute principle underlying the universe, combining within itself the principles of yin and yang and signifying the way, or code of behavior, that is in harmony with the natural order. The interpretation of Tao in the Tao-te-Ching developed into the philosophical religion of Taoism.
I'd say their interpretation (while reductive) is in the spirit of the Tao.
That said, I'm no expert and only have a passing familiarity with the Tao through pop-culture.
Re:The Tao of Go
by tmtvl on Wednesday February 12, 2025 @05:56AM
(#43024077)
My favourite Go proverb is probably 'don't go fishing while your house is on fire'.
Deciding you want to reduce your opponent's moyo while you have a group that's struggling to live is a good way to lose the game; and the proverb is applicable in everyday situations too.
Re:The Tao of Go
by fransje26 on Thursday February 13, 2025 @12:44PM
(#43038849)
> Deciding you want to reduce your opponent's moyo while you have a group that's struggling to live is a good way to lose the game; and the proverb is applicable in everyday situations too.
Sure, but how does that apply to programming in general? And more specifically, to Go?
I wish go people actually did this. Also it's just not true. The standard library is full of private structs that are returned as interfaces. Just look at the net library for example. Non of the listener structs are exposed. Only the net.Listener interface
And of course the biggest offender is error which is an interface and the return value of basically every function. And you're basically writing type assertions all day
Hang on, you can't just go around naming the Tao.
> (in Chinese philosophy) the absolute principle underlying the universe, combining within itself the principles of yin and yang and signifying the way, or code of behavior, that is in harmony with the natural order. The interpretation of Tao in the Tao-te-Ching developed into the philosophical religion of Taoism.
I'd say their interpretation (while reductive) is in the spirit of the Tao.
That said, I'm no expert and only have a passing familiarity with the Tao through pop-culture.
I’m led to understand that that is canonically the best attainable case of any description of the Tao in words.
Deciding you want to reduce your opponent's moyo while you have a group that's struggling to live is a good way to lose the game; and the proverb is applicable in everyday situations too.
Sure, but how does that apply to programming in general? And more specifically, to Go?