Parameter naming: filename or fileName?

前端 未结 9 2034
情歌与酒
情歌与酒 2020-12-29 19:26

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

9条回答
  •  情歌与酒
    2020-12-29 20:04

    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.

提交回复
热议问题