gpt4 book ai didi

java - 大写缩写的命名约定

转载 作者:IT老高 更新时间:2023-10-28 20:49:32 26 4
gpt4 key购买 nike

是否应该调用返回 XML 流的方法

public Stream getXmlStream();

或者改为

public Stream getXMLStream();

您对此有何看法?什么是最佳做法?

最佳答案

没有一个正确的答案。这个wiki提取物很有帮助:

Programming identifiers often need to contain acronyms and initialisms which are already in upper case, such as "old HTML file". By analogy with the title case rules, the natural camel case rendering would have the abbreviation all in upper case, namely "oldHTMLFile". However, this approach is problematic when two acronyms occur together (e.g., "parse DBM XML" would become "parseDBMXML") or when the standard mandates lower camel case but the name begins with an abbreviation (e.g. "SQL server" would become "sQLServer"). For this reason, some programmers prefer to treat abbreviations as if they were lower case words and write "oldHtmlFile", "parseDbmXml" or "sqlServer".

关于java - 大写缩写的命名约定,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8277355/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com