.net - character casing for abbreviations in dotnet -
have ever wondered why ms doesn't write abbreviations in upper case? guid, bmpbitmapencoder, system.net.mime, httpwebrequest, xmldocument, etc., instead of guid, bmpbitmapencoder, system.net.mime, httpwebrequest, xmldocument. suspect it's better readability, in opinion, it's worse, , maybe bit incorrect. there ms document explains why decided this? i'm sure it's intentional, here's bonus question, find name in bcl contains upper case abbreviation :)
the rule use two-character acronyms left uppercase: ioexception
while longer acronyms treated words , use initial cap.
from http://msdn.microsoft.com/en-us/library/ms229043.aspx:
the following guidelines specify proper casing short , long acronyms. identifier casing rules take precedence on acronym casing rules.
do capitalize both characters of two-character acronyms, except first word of camel-cased identifier.
a property named
dbrateexample of short acronym (db) used first word of pascal-cased identifier. parameter namediochannelexample of short acronym (io) used first word of camel-cased identifier.do capitalize first character of acronyms 3 or more characters, except first word of camel-cased identifier.
a class named
xmlwriterexample of long acronym used first word of pascal-cased identifier. parameter namedhtmlreaderexample of long acronym used first word of camel-cased identifier.do not capitalize of characters of acronyms, whatever length, @ beginning of camel-cased identifier.
a parameter named
xmlstreamexample of long acronym (xml) used first word of camel-cased identifier. parameter nameddbservernameexample of short acronym (db) used first word of camel-cased identifier.
Comments
Post a Comment