开发者

Name convention Controls on Forms Tips

I found out this article I would like share with you.

http://10rem.net/articles/net-naming-conventions-and-programm开发者_StackOverflow中文版ing-standards---best-practices

Naming convention for controls

Regarding name conventions for "Controls on Forms", I thought to use this:

ux-Description-GeneralType

Example:

uxUserIdInput

PRO:

  1. have IntelliSense group all my Controls
  2. possibility to identifu the type in IntelliSense
  3. If I change the Type I do not need to update my code

Because I am pretty new at developing, I would like start with the right foot and using solid practices.

Do you guys agree with that. Would you advice some other name convention?

Thanks for your time! bye


As long as your convention is documented and followed by all members of the team, it is fine whatever the convention. Define your conventions once, stick to it for the lifetime of a project. If you need to change the convention, change it for the next project.

Keep in mind though that Microsoft recommends to remove this kind of prefixes from the variable names. As such, FxCop would complain (unless told to ignore this rule).


Your conventions are fine, especially as they do not deviate from the rest of .NET.

What matters the most (as already written on the SO reference) is consistency.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜