Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CamelCasing: HTMLReport vs. HtmlReport

Often you would use well or somewhat established abbreviations in class or method names. But how do you CamelCase or camelBack them?

  • HTMLReport vs. HtmlReport
  • CustomerDAO vs. CustomerDao
  • XMLRPC vs. XmlRpc

Which side is correct (or which would you prefer)?

like image 365
Markus Avatar asked Jun 15 '11 21:06

Markus


1 Answers

In Java there's little choice, if you want to treat HTML as one word, it has to be written as html or Html. For example, due to Java beans convention, getHTML() implies a property named hTML.

It's really up to the opponent to answer this question, why should HTML be in all capital letters? English convention? Who cares? If we follow English convention we should have spaces between words.

like image 112
irreputable Avatar answered Oct 22 '22 15:10

irreputable