views:

201

answers:

5

Possible Duplicate:
Parameter naming: filename or fileName?

What do you use - filename or fileName? The classes in the JDK use a lower case 'n', e.g. FilenameFilter, so, for consistency, I do too. But the correct way, I believe, should be fileName (as in C#).

+1  A: 

filename

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

Kris
+1  A: 

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

JesperE
+2  A: 

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

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

Personally I vote for "filename".

RichN
+5  A: 

I'd base that decision on the surrounding identifiers.

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

Example:

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

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

private String fileName;
private long fileSize
private DateTime fileAge;
DR
this makes lot more sense
Dapeng
+2  A: 

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

stmax