Search code examples
variablesnaming-conventionscamelcasing

CamelCase for internal capital word


Sorry this might be a very meta question, What should I name a variable with internal capitalized word? for example, get FX rate,

getFXrate?
getFxRate?
getFXRate?

Or is there some material I can read upon?

Best Regards


Solution

  • One common approach is to use CamelCase only for abbreviations which are three characters ore more, for instance GetXmlSchema. In your example, however, where the abbreviation has only two characters, it would be the third alternative, GetFXRate.