c# - Camel 套管的缩写?

标签 c# java

这个问题可能看起来很迂腐或愚蠢,但是当涉及到首字母缩略词时,您对 Camel 套管的做法是什么?您是否坚持所有内容,甚至首字母缩略词都必须是驼峰式,或者您是否对首字母缩略词异常(exception)。解释也会很棒。我不确定这种做法如何影响 IDE 功能(自动完成)或行业标准是什么。

最佳答案

对于 C#,请查看 Microsoft's guidelines :

Do capitalize both characters of two-character acronyms, except the first word of a camel-cased identifier.

A property named DBRate is an example of a short acronym (DB) used as the first word of a Pascal-cased identifier. A parameter named ioChannel is an example of a short acronym (IO) used as the first word of a camel-cased identifier.

Do capitalize only the first character of acronyms with three or more characters, except the first word of a camel-cased identifier.

A class named XmlWriter is an example of a long acronym used as the first word of a Pascal-cased identifier. A parameter named htmlReader is an example of a long acronym used as the first word of a camel-cased identifier.

Do not capitalize any of the characters of any acronyms, whatever their length, at the beginning of a camel-cased identifier.

A parameter named xmlStream is an example of a long acronym (xml) used as the first word of a camel-cased identifier. A parameter named dbServerName is an example of a short acronym (db) used as the first word of a camel-cased identifier.

关于c# - Camel 套管的缩写?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4504508/

相关文章:

java - 在 Java 中去除无效的 XML 字符

java - 在循环中命名数组

C# 获取自定义属性目标的成员信息

c# - 使用动画类的跳跃动画

c# - 如何在 C# 中将 lambda 表达式与 asp.net DataList 一起使用

c# - "opening a connection"实际上是什么意思?

java - GWT 2.6 - Java 6 冲突

java - 从更大的数组生成随机数数组?

java - Eclipse 创建 JVM 失败

c# - Entity Framework 代码第一次延迟