[go-nuts] FunctionName caseinconsistencies

81 views
Skip to first unread message

Seth Hoenig

unread,
Apr 20, 2010, 11:25:17 PM4/20/10
to golang-nuts
I have noticed while learning Go that function names are sometimes
capitalized only on the first character, while others are capitalized
on every significant word. For example, in os.File, there is
"File.Readdirnames", and also "File.WriteString" .

While not show stopping, I find inconsistencies like this to be
something I wish were fixed in other languages, and thought maybe Go
could hit this annoyance head on before it becomes too popular to
change?



--
Subscription settings: http://groups.google.com/group/golang-nuts/subscribe?hl=en

Russ Cox

unread,
Apr 20, 2010, 11:32:34 PM4/20/10
to Seth Hoenig, golang-nuts
> While not show stopping, I find inconsistencies like this to be
> something I wish were fixed in other languages, and thought maybe Go
> could hit this annoyance head on before it becomes too popular to
> change?

I don't think we're anywhere near too popular to change. ;-)

A lot of the all lowercase names were chosen before we
had really figured out what the naming conventions should be.
The rule we adopted, which might be worth revisiting later,
was that entry points in package os or syscall, which are
named after equivalents in C, just had a single capital at
the beginning, to avoid needing to decide where the
internal capitalizations are in abbreviations like geteuid
or getwd or chdir. Names like Readdirnames, which are
actual words, might be worth revisiting at some point.

Russ
Reply all
Reply to author
Forward
0 new messages