If I’ve got a variable that contains the fully-qualified name of a file (for example, a project file), should it be called projectFile, projectFileName or projectPath? Or something else?
If I’ve got a variable that contains the fully-qualified name of a file (for
Share
I usually go with these:
FileNamefor the file name only (without path)FilePathfor the parent path only (without the file name)FileFullNamefor the fully qualified name with pathI don’t think there is such a thing as an accepted standard for this. I depends on your (team’s) preferences and whether you need to differentiate between the three in a given situation.
EDIT: My thoughts on these particular naming conventions are these:
I cannot always stick to these conventions, but I try to. If I decided to use a particular naming pattern I am consistent even if it means that I have to write more descriptive (= longer) variable names. Code is more often read than written, so the little extra typing doesn’t bother me too much.