James Aguilar
unread,Nov 11, 2009, 3:21:25 AM11/11/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to golang-nuts
Hey guys,
I'm sure you've discussed this to death before the public release of
the project, but I just want to jump in to say I think optional
semicolons on statements inside functions are fishy. Effective Go says
that semicolons are often left off one-liners, but one-liners often
become two-liners as programs are built over time. I suppose that our
editors will show us the error through indentation, but it seems
simpler just to require them on all statements inside functions and be
done with it.
I suspect that this feature will become one of those things that is
constantly tripping up newbies like optional braces in C. If this
feature is kept, there should probably be a specific diagnostic for it
rather than
foo.go:21: syntax error near s
which is what we get today when the compiler encounters
s += " "
s += " ";
It's going to be hard for anyone new to the language to spot problems
like this, since in most other languages adding an independent
statement to an ordinary block does not require changing other lines
in that block.
-- James