Acronyms in Camel Back

Stroboskop picture Stroboskop · Jul 24, 2009 · Viewed 8.6k times · Source

I often see Java class names like

XmlReader

instead of

XMLReader

My gut feeling is to completely upper case acronyms, but apparently many people think differently. Or maybe it's just because a lot of code generators are having trouble with acronyms...

So i would like to hear the the public opinion. How do you capitalize your class names containing acronyms?

Answer

AronVanAmmers picture AronVanAmmers · Jul 24, 2009

We use the camel case convention like Java and .NET do. Not for reasons of code generators, but for readability. Consider the case of combining two acronyms in one name, for example a class that converts XML into HTML.

XMLHTMLConverter

or

XmlHtmlConverter

Which one do you prefer?