The only time I start a variable with an upper case letter within a
function is when I am coding from some reference document that I will cite.
In this case I try to stick as close as possible to the names in the
reference document for the benefit of anyone that might want to check my
code. Otherwise, I always start with lower case.
But that's not quite what you asked. Camel case (which I assume you mean
by title case) is a technique for multiword names. Generally functions are
small enough that multiword local variables are not needed. I use one
letter variable names as long as I can pick a letter that is possibly
suggestive or at least not confusing. I'm happy with two or three letter
names as well. For example I might name a variable mw rather than
multiword. In rare cases where I think something really needs to be
spelled out to keep the reader from getting lost or confused, I use camel
case starting with lower case letter, like multiWord. I think that's
preferable to reminding the reader with comments like
mw = false // not multi word
On Saturday, January 26, 2013 11:23:50 AM UTC-5, robfig wrote:
Is there any difference between exported and unexported variables if they
are defined within a func?
Assuming the answer is no, does anyone use TitleCase variables within a
func for any semantic purpose?