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 camel-cased identifier. A parameter named htmlReader is an example of a long acronym used as the first word of a camel-cased identifier.
Posted Wednesday, 5 December, 2007 - 19:10 by the Fiddler
Moved from here
On December 5th, 2007 ccoish says:
I hate to be pedantic, but I think I found one case where the library still doesn't adhere to naming conventions. Anything that contains 1d, 2d, 3d, etc. should probably have 1D, 2D, 3D instead. This seems to be the same situation as System.Drawing.Drawing2D, and you can see for yourself how that goes.
To quote the Capitalization Conventions of the naming guidelines:
Microsoft themselves have occasionally broken this rule with things like OleDbConnection. There's also an FxCop rule (CA706) that talks about this:
Short acronyms should be uppercase
Two letter acronyms should be upper-cased. For example, use System.IO instead of System.Io. Although it may be common practice for some two letter acronyms to not be fully capitalized, violations of this rule should not be excluded for this reason. For example, 'DbConnection', is common but incorrect; use DBConnection. A violation of this rule might be required for compatibility with existing, non-managed symbol schemes. In general, however, these symbols should not be visible outside the assembly that uses them.
- http://www.frontendart.com/monitor/help/csharp/node21.html
Personally, I think there just isn't agreement in Microsoft as to whether DB is an acronym for data base or an abbreviation for database (the way Id is for identifier). Either way, I'm pretty sure 3D is an acronym for 3 dimensional.
Posted Wednesday, 5 December, 2007 - 21:14 by the Fiddler
This change makes sense, especially since OpenGL functions like TexImage2D use an uppercase 'D'. It is easy to add a rule to the generator for this, but it would break apps once again. On the other hand, better do that now than later...
Comments
Because this is dictated by
Because this is dictated by the .Net naming conventions:
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 camel-cased identifier. A parameter named htmlReader is an example of a long acronym used as the first word of a camel-cased identifier.
Moved from here On December
Moved from here
On December 5th, 2007 ccoish says:
I hate to be pedantic, but I think I found one case where the library still doesn't adhere to naming conventions. Anything that contains 1d, 2d, 3d, etc. should probably have 1D, 2D, 3D instead. This seems to be the same situation as System.Drawing.Drawing2D, and you can see for yourself how that goes.
To quote the Capitalization Conventions of the naming guidelines:
Do capitalize both characters of two-character acronyms, except the first word of a camel-cased identifier.
- http://msdn2.microsoft.com/en-us/library/ms229043.aspx
Microsoft themselves have occasionally broken this rule with things like OleDbConnection. There's also an FxCop rule (CA706) that talks about this:
Short acronyms should be uppercase
Two letter acronyms should be upper-cased. For example, use System.IO instead of System.Io. Although it may be common practice for some two letter acronyms to not be fully capitalized, violations of this rule should not be excluded for this reason. For example, 'DbConnection', is common but incorrect; use DBConnection. A violation of this rule might be required for compatibility with existing, non-managed symbol schemes. In general, however, these symbols should not be visible outside the assembly that uses them.
- http://www.frontendart.com/monitor/help/csharp/node21.html
Personally, I think there just isn't agreement in Microsoft as to whether DB is an acronym for data base or an abbreviation for database (the way Id is for identifier). Either way, I'm pretty sure 3D is an acronym for 3 dimensional.
So following this rule, constants like:
should probably be changed to
This change makes sense,
This change makes sense, especially since OpenGL functions like TexImage2D use an uppercase 'D'. It is easy to add a rule to the generator for this, but it would break apps once again. On the other hand, better do that now than later...