I try to be grammatically correct in my naming*. I\'ve always used filename
instead of fileName
. The java convention also seems to use this, but
As far as I am concerned,
thisIsMuchMoreReadable
thanreadingthis
.
'filename'
assumes that this word describes a singular object like 'cow' or 'chair'
'fileName'
assumes that this is a complex object, that there is an object called file and that this object describes the name of that file.
Two philosophical approaches, take your pick.
I think the answers here are spanning two issues.
'FileName' vs 'Filename' (should 'name' be a separate word)
and
'fileName' vs 'FileName' (should first character be lower case).
In most cases, I prefer to treat this word as a single whole word 'filename'. I also prefer starting variables/methods with lower case for easier code completion menu navigation.
I guess the issue of camel case is here too which I think should be used to distinguish multi-word names.