I'm a new Go programmer (learning in my spare time) and decided to share my
initial fumbles and what? why? moments while they're still fresh.
First suggestion: allow a colon to be inserted between the name(s) and type
in declarations. For example
x : int
func random(): real
Back in the previous century I wrote a lot of Pascal code and a little Ada,
so
I'm fine with the idea of Go reversing the declaration syntax away from C.
But
because of that experience I keep typing a colon between the names.
For those without Pascal experience, I still think it would be worthwhile
for
consistency and readability.
Consistency: we already have name = value and name := value and type.
The : becomes the 'type declaration' operator.
For readability, while I appreciate the intent to shorten the code, I find
it takes
longer for me to parse
x, y, z int
because the absence of the comma is what matters. It's significant white
space,
(which again I'm generally OK with) but very short. I find it harder to
look for
something that isn't there, rather than a divider or delimiter. Already I
seem to
be inserting extra spaces before the type name just to make it stand out.
cheers,
Hugh Fisher
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.