3 ms·
"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 st
by nickpresta 14y ago
"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)."