Closed simonlynen closed 11 years ago
As with the underscore, I am worried about over-verbose style. There are some cases when a getter would better use a different naming, such as isEmpty()
instead of getEmptyStatus()
.
Google uses something like getVariableMutable(), which is more of a language-independent way to say it. I'm not against verbosity in general (this is probably obvious to everyone). I haven't been using get/set religiously up to this point but I wouldn't mind starting now.
I do agree, however, that it is nicer to have meaningful names for things. I would advocate isEmpty() over getEmptyStatus().
Now that I'm thinking, getVariableMutable() is nice because it is really clear what is happening.
Can anyone convince me otherwise?
@furgalep Paul can you think of a proper english term for the reference getters?
I just looked up the synonyms for mutable and nothing is jumping out at me.
How about
getVariableRef()
it is better than getVariableMut()
Good lets go for: getVariableRef()
Should this be called differently, something along these lines?
getRef() ref()