Parameter naming: filename or fileName?

前端 未结 9 2043
情歌与酒
情歌与酒 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:02

    '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.

提交回复
热议问题