News for hackers. Stuff that matters.
Re:Having a Go - first time experience with Golang by nickpresta on Monday July 09, 2012 @12:07PM (#4218799)
"1. Reversing type and variable/parameter name is just aesthetics I guess but it still really bothers me. Perhaps there's a reason (eg parsing speed) but I'd still prefer: float32 f1 float32 f2 = 45.4 over var f1 float32 var f2 float32 = 45.4"

I've always found this a nice change.

The first way, you read it as: I have a float variable, named f1 and its value is 45.4.

The second way, you read it as: I have a variable named f1, it's a float, and its value is 45.4.

The second seems more natural to me, putting emphasis on your name and value, instead of the type. It is even more obvious when you use the := syntax. `f1 := 45.4` => "I have a variable named f1, whose value is 45.4 (a float)."

There are no comments on this comment yet.