0

I'm trying to find a definition of a "casing standard" that allows two capitalized letters to follow directly after each other. An example of this is HTMLInputElement that seemingly defies the rules. I prefer this, even though it breaks the strict naming rules, which would require it to be HtmlInputElement instead. Does anyone know if there's an official name for this casing subset because I don't think it adheres to either of these standards... but perhaps this is also one of the differences between Pascal Case and Upper Camel Case and it hasn't been defined well enough in the existing definitions I've found online?

Kevin
  • 83
  • 8

2 Answers2

1

I'm not sure if that casing standard exists, I think it's just an exception in camel case when there is an abbreviated term like HTML.

Here's another version of the question: Acronyms in CamelCase

Apparently Microsoft guidelines state (according to this article):

When using acronyms, use Pascal case or camel case for acronyms more than two characters long. For example, use HtmlButton or htmlButton. However, you should capitalize acronyms that consist of only two characters, such as System.IO instead of System.Io.

Do not use abbreviations in identifiers or parameter names. If you must use abbreviations, use camel case for abbreviations that consist of more than two characters, even if this contradicts the standard abbreviation of the word.

Although pretty debated, I'm not sure there is a perfectly correct answer to your question. Lots of this is based to opinion and interpretation.

coddingtonjoel
  • 189
  • 2
  • 12
  • I'm guessing that the reason for not defining it as a standard is that it is hard to automate. That said, without having to have an algorithm assign an identifier name a human can probably do a good enough job... so I'd still like to see it as a standard that's defined. I find it hard to believe that no-one has defined it this way for any project. – Kevin Apr 26 '20 at 14:35
  • Thanks for the link to the "Acronyms in CamelCase" - that's helpful – Kevin Apr 26 '20 at 14:41
  • (I'll keep this question open for a while to see if anyone else has any links to standards set by projects that may be using this "standard") – Kevin Apr 26 '20 at 14:42
0

Since it appears that there is no name for this and I've given it a while, I'm going to officially name it "Acronym Case" :-)

Kevin
  • 83
  • 8