[ACCEPTED]-fileName or filename?-naming-conventions

Accepted answer
Score: 25

I'd base that decision on the surrounding 4 identifiers.

If filename is the only identifier regarding 3 files in its context, I'd stay with that.


public void load(String filename) { ... }

But 2 as soon as you have other file attributes 1 I'd consider using this:

private String fileName;
private long fileSize
private DateTime fileAge;
Score: 9

my dictionary says "filename" so 1 i'd keep using a lowercase "n": http://dict.leo.org/?search=filename

Score: 8

The real question is whether the thing is 5 called "file name" or "filename".
The 4 rest is then a trivial matter.

The Wikipedia 3 article is filename, even though the content has 2 both "file name" and "filename".

Personally 1 I vote for "filename".

Score: 4


Like you, I do it to be consistent with 1 the Java libraries.

Score: 2

I'm not really consistent, but I tend to 3 use "filename", even though fileName would 2 be more grammatically correct since "file 1 name" is two words, not one.

More Related questions