Question

I've been working with the XMLHttpRequest object in JavaScript recently, and I couldn't help but notice that the casing of this name makes no sense. Why is 'XML' all in caps while 'Http' is not? They're both acronyms!

Surely it'd make more sense for the name to be one of the following:

  • XmlHttpRequest (PascalCase, best practice for class names in JavaScript)
  • xmlHttpRequest (camelCase, also common though not for classes)
  • XMLHTTPRequest (caps-for-acronyms, rarely used in programming?)

I'm sure there must be some reason and I'd hate to think it's now set in stone just because no one questioned this at the time. Is there another naming convention that I'm unaware of?

No correct solution

Licensed under: CC-BY-SA with attribution
scroll top