参数命名:文件名还是文件名? [英] Parameter naming: filename or fileName?

查看:189
本文介绍了参数命名:文件名还是文件名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在命名上力求语法正确*.我一直使用filename而不是fileName. Java约定似乎也使用此方法,但是FxCop更喜欢fileName.

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 FxCop prefers fileName.

关于WikiPedia的讨论 .我读得越多,我就越觉得自己是对的(这很平常!:)).有人能给出明确的答案吗?还是仅仅是主观的?

There's a discussion on WikiPedia about it. The more I read, the more I feel I'm right (which is quite usual! :) ). Does anyone have a definitive answer or is this merely something subjective?

*我只希望这篇文章中没有语法错误!

* I just hope there are no grammar errors in this post!

推荐答案

写文件名"或文件名"是可接受的英语.当您将其转换为编码时,可以大写"n"或不大写"n"(假设使用camelCase或PascalCase).

It is acceptable English to write "filename" or "file name". When you translate that into coding, capitalizing the "n" or not capitalizing the "n" can go either way (assuming camelCase or PascalCase).

顺便说一句,您确实在问题中犯了语法错误-具有讽刺意味的是,在您表达希望没有语法错误的那句话中.您说:我只是希望这篇文章中没有语法错误!"但是错误"是复数形式,因此有"的是"表示主语-动词的分歧.

By the way, you did make a grammatical error in the question--ironically, in the very sentence in which you were expressing your hope that there were no grammatical errors. You said, "I just hope there's no grammar errors in this post!" But "errors" is plural, therefore the "is" of "there's" represents a subject-verb disagreement.

*我只希望这篇文章没有语法错误!

* I just hope there are no grammatical errors in this post!

这篇关于参数命名:文件名还是文件名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆