Should a method that returns an XML stream be called
public Stream getXmlStream();
or instead
public Stream getXMLStream();
What's your opinion about that? What's considered best practice?
Should a method that returns an XML stream be called
public Stream getXmlStream();
or instead
public Stream getXMLStream();
What's your opinion about that? What's considered best practice?
You should probably go for
getXmlStream
. Think ofparseDBMXML
or more complicated examples that make the code unreadable.Comes from wikipedia CamelCase
using
public Stream getXMLStream();
will be advisable Its better to keep original meaning of abbreviationThere is no one correct answer. This wiki extract is helpful:
A "convention" is just that - it's not a "rule". However, I feel strongly that
getXmlStream()
is the best option. Consider multiple such terms: comparegetSQLDBIOXML()
togetSqlDbIoXml()
I'm not saying it
should
be this way but for some, they can automatically adjust/expect that when there's a sequential string of upper-cased letters followed by lower-cased letters there is an acronym somewhere. Myopinion
is to go withgetXmlStream()
--it's something that Ithink
is something easier for most people to read, compared to the number of those instantly able to readgetXMLStream()
with ease..