黄色鞋子配什么颜色裤子| 青砖茶属于什么茶| 经常眩晕是什么原因| 小孩趴着睡觉是什么原因| 卫生湿巾是干什么用的| 露从今夜白下一句是什么| 今天什么时候下雨| 各类病原体dna测定是检查什么| 为什么胸会痛| 禅心是什么意思| 抗生素药对人体有什么危害| 一什么知什么成语| 布帛是什么意思| 同房为什么会出血| 什么是非处方药| 白牌黑字是什么车牌| 紫荆花的花语是什么| 搭档是什么意思| 低骨量是什么意思| 儿童过敏性咳嗽吃什么药| 半夜醒来口干舌燥是什么原因| 胎儿右侧脉络丛囊肿是什么意思| 婴儿拉肚子是什么原因造成的| 肛裂涂什么药膏能愈合| 时柱亡神是什么意思| 50岁女人出轨为了什么| 中班小朋友应该学什么| 薏米不能和什么一起吃| 雄激素过高是什么意思| 高铁座位为什么没有e座| 什么样的人做什么样的事| 夏天结婚新郎穿什么衣服图片| 祸起萧墙的萧墙指什么| 生姜吃多了有什么害处| 大姨妈期间不能吃什么东西| 梦见好多水是什么预兆| 境字五行属什么| cea升高是什么意思| 坛城是什么意思| 芒果有什么营养| 化验痰可以检查出什么| 舌头上有红点点是什么原因| 孕妇抽筋是什么原因引起的| 什么是再生纤维面料| 空囊是什么原因造成的| 耳道炎用什么药最有效| 观音坐莲是什么姿势| 站桩对身体有什么好处和功效| 宝路华手表什么档次| 风平浪静是什么生肖| 乌冬面是什么做的| 积滞是什么意思| 金庸原名叫什么| l do是什么意思| 松茸是什么东西| 例假少吃什么药| 浑身解数是什么意思| 屁多且臭是什么原因| 吃什么补蛋白质| 独角仙吃什么食物| edifice是什么牌子手表| 脚踩棉花感见于什么病| 啪啪啪是什么意思| 肉桂属于什么茶| 1月3号是什么星座| 曲拉是什么| 起鸡皮疙瘩是什么原因| 什么样的人不能坐飞机| 闰月鞋买什么颜色| 耳鸣吃什么药最好| 荷尔蒙是什么东西起什么作用| 补气固表什么意思| 始终如一是什么意思| 不易是什么意思| 烤鸭为什么那么便宜| 慢性前列腺炎有什么症状| 做完肠镜需要注意什么| 沙拉是什么意思| 蜂蜜不能和什么一起吃| 分数是什么| 蝙蝠属于什么类| 为什么发际线高| 痔核是什么| 勾心斗角是什么意思| 什么叫体位性低血压| 油腻是什么意思| 康五行属什么| 4月6日什么星座| 清华大学校长是什么级别| 断码是什么意思| 为什么叫买东西不叫买南北| 曲马多是什么| 麝香保心丸治什么病| 肌酐测定低是什么意思| 偏头痛不能吃什么食物| 什么现象说明奶吸通了| 什么化痰效果最好最快| 射手座喜欢什么样的女生| 穷极一生是什么意思| 心影饱满是什么意思| 虾片是什么做的| 蚊虫叮咬红肿用什么药| romoss是什么牌子| 无休止是什么意思| hpv什么病| 青年补钙吃什么好| 张学良为什么不回大陆| 放疗后不能吃什么| 布鲁斯是什么意思| 上海话十三点是什么意思| 泡是什么意思| 血氧仪是干什么用的| 巳时五行属什么| 鸭梨是什么颜色| esr是什么| 什么泉水| 一什么头巾| 草字头的字和什么有关| 置之死地而后生是什么意思| 笔画最多的字是什么字| 安全监察是一种带有什么的监督| 脚冰冰凉是什么原因| 感冒吃什么食物比较好| 产复欣颗粒什么时候吃| 溪字五行属什么| 腰疼挂什么科室| 利多卡因是什么| 胃不好吃什么水果| 拂尘是什么意思| 2t是什么意思| 总是心慌是什么原因| 老年痴呆症是什么原因引起的| 别有洞天是什么生肖| 手莫名其妙的肿了因为什么| 口腹蜜剑什么意思| 天津有什么特产| 什么的鹿角| 低血钾是什么原因引起的| 吃什么药可以流产不用去医院| 谷子是什么意思| 红顶商人是什么意思| 麦粒肿涂什么药膏| 子宫内膜薄有什么症状| 内裤发黄是什么原因呢| 解痉镇痛酊有什么功效| 什么什么的田野| 吃什么治疗便秘| 初代是什么意思| 长白头发了吃什么才能把头发变黑| 11.1是什么星座| 1963属什么生肖| 枕大池增大什么意思| 重阳节又称什么节| 热狗是什么| 红男绿女是什么生肖| 黄泉是什么意思| 赛字五行属什么| 胸闷气短吃什么药疗效比较好| 天孤星是什么意思| 脂溢性脱发是什么原因引起的| 宫颈息肉吃什么药能消| 呆呆的笑是什么笑| 7o年属什么生肖| 脾虚是什么原因引起的| 瘦西湖为什么叫瘦西湖| 三十三天都是什么天| 医院脱毛挂什么科| 嘴唇周围长痘痘是什么原因导致| 乙肝复查检查什么项目| 放飞自我是什么意思| 金蟾吃什么| 牙结石是什么| 2004年属猴的是什么命| 胃部间质瘤是什么性质的瘤| 男票是什么意思| 老婆的妈妈叫什么| 脑内多发缺血灶是什么意思| 手指缝溃烂擦什么药膏| 重听是什么意思| 海里有什么鱼| 前列腺钙化是什么原因引起的| 7月1号什么节| 脂蛋白高吃什么药能降下来| 智齿发炎肿痛吃什么药| 尿蛋白微量是什么意思| 起死回生是什么生肖| 什么花秋天开| 什么是吸附性义齿| 淋巴细胞绝对值偏高是什么意思| 鹅蛋有什么功效| 四月份什么星座| 甲状腺毒症是什么意思| 不由自主的摇头是什么病| 民政局局长什么级别| 白发越来越多是什么原因造成的| 头发突然秃了一块是什么原因| 苦瓜泡酒有什么功效和作用| 脑疝是什么原因引起的| 阴壁有许多颗粒是什么原因| 狗皮肤溃烂用什么药| 章子怡是什么脸型| 碳酸钙d3颗粒什么时候吃最好| 马拉松起源与什么有关| 婴儿呛奶是什么原因引起的| 嘴唇发白什么原因| mf是什么意思| 走马灯什么意思| 少年班是什么意思| 靶向药物是什么| 崩漏是什么意思| 朋友圈屏蔽显示什么| 尿素肌酐高是什么原因| 小宇宙是什么意思| 副脾是什么意思| 生长激素分泌的高峰期是什么时候| 什么是肺部腺性肿瘤| 二米饭是什么| 什么年龄割双眼皮最好| 教研是什么意思| 红斑是什么病| 吧可以组什么词| 属龙的和什么属相最配| 茄子把有什么功效| 李世民属相是什么生肖| 为什么要做试管婴儿| 贫嘴是什么意思| 睾丸小是什么原因| 睡着后抽搐抖动是什么| 自闭症是什么病| 打呼噜是什么引起的| 什么的波涛| 数字3五行属什么| 翕什么意思| 手指甲出现竖纹是什么原因| kiv是什么车| 94年什么生肖| 长期咳白痰是什么原因| 太平猴魁属于什么茶类| 仁慈是什么意思| 眼睛有点黄是什么原因| 1999年出生的属什么| 竹子可以做什么| 国企属于什么编制| 睡眠不好去医院挂什么科| 硒中毒有什么症状| 女龙配什么属相最好| 新疆有什么特产| 什么马| 什么是菩提| 生完孩子可以吃什么水果| 胃窦是什么意思| 破伤风疫苗什么时候打| 诸葛亮是什么星座| 长期失眠挂什么科| 疱疹病毒是什么引起的| 牛肚是什么部位| 花容月貌是什么意思| 幼儿园中班学什么| 四十不惑是什么意思| 支行行长什么级别| 沙弗莱是什么宝石| 左肾小囊肿是什么意思| 15天来一次月经是什么原因| 户籍所在地是指什么| 百度
rfc:class-naming-acronyms

工信部副部长辛国斌:走中国特色智能制造之路

Introduction

百度 如果按照SUV和轿车的阵营划分,那二者的销量之比约为:1。

The results of the Class Naming RFC decided that class names should be written in PascalCase (“Upper Camel Case”), with the exception of acronyms, which should be included in UPPERCASE. This RFC proposes to revisit the prior decision, instead treating acronyms like regular words, making classnames consistent PascalCase.

Reasoning

It is not consistently applied

As an example ext/json has JsonException which should've been JSONException according to the previous RFC’s results. In fact JsonException’s RFC was created just 3 months (!) after the class naming RFC in September 2017.

Another example is ext/curl which has both CurlHandle and CURLFile. CURLFile predates the RFC, but there's also CURLStringFile which was added in PHP 8.1 and likely followed CURLFile’s naming for consistency, but violating the RFC and being inconsistent with CurlHandle.

ext/random’s Random\Engine\PcgOneseq128XslRr64 would've needed to be called Random\Engine\PCGOneseq128XSLRR64 according to the class naming RFC.

The PDO driver specific sub-classes RFC voted (and accepted) for PHP 8.3 and implemented in PHP 8.4 uses Pdo<Driver>, e.g. PdoOdbc instead of PDOODBC.

It decreases readability

It is well-established in accessibility circles that ALL CAPS text is harder to read than Mixed Case, as mixed case provides greater vertical variation between letters, making it easier to read, especially for people with various reading disorders.

Most accessibility organizations recommend against ALL CAPS. For example:

That issue is amplified if multiple acronyms follow each other. One example is the PCGOneseq128XSLRR64 mentioned above: It’s not clear that XSL (XorShiftLow) and RR (RandomlyRotate) are two different acronyms.

Likewise PDOODBC is much harder to parse than PdoOdbc.

Another example might be JavaScript’s XMLHttpRequest which incidentally mixes both variants. According to the class naming RFC it would need to be called XMLHTTPRequest, resulting in 8 consecutive uppercase characters.

The userland convention is mostly MixedCase

Although there is no formal standard in userland for handling initialisms, the most widely used convention is to only capitalize the first letter. For example:

Although this RFC has no direct impact on userland code, normalizing conventions between Internals and userland has many benefits. The PER-CS working group, part of the PHP-FIG, has been asked to adopt a standard for initialisms and would likely follow suit with this RFC if passed.

Proposal

Update to the Policy

The class naming policy should be updated to the following, with changes highlighted:

Method names follow the studlyCaps (also referred to as bumpy case or camel caps) naming convention, with care taken to minimize the letter count. The initial letter of the name is lowercase, and each letter that starts a new word is capitalized.

Class names should be descriptive nouns in PascalCase and as short as possible. Each word in the class name should start with a capital letter, without underscore delimiters. The class name should be prefixed with the name of the “parent set” (e.g. the name of the extension) if no namespaces are used.

Abbreviations and acronyms as well as initialisms should be avoided wherever possible, unless they are much more widely used than the long form (e.g. HTTP or URL). Abbreviations start with a capital letter followed by lowercase letters, whereas acronyms and initialisms are written according to their standard notation. Abbreviations, acronyms, and initialisms should be treated like regular words, thus they should be written with an uppercase first character, followed by lowercase characters. Usage of acronyms and initialisms is not allowed if they are not widely adopted and recognized as such.

Diverging from this policy is allowed to keep internal consistency within a single extension, if the name follows an established, language-agnostic standard, or for other reasons, if those reasons are properly justified and voted on as part of the RFC process.

Examples

Good method names:

connect()
getData()
buildSomeWidget()
performHttpRequest()

Bad method names:

get_Data()
buildsomewidget()
getI()
performHTTPRequest()

Good class names:

Curl
CurlResponse
HttpStatusCode
Url
BtreeMap // B-tree Map
UserId // User Identifier
Char // Character
Intl // Internationalization
Ssl\Certificate
Ssl\Crl // Certificate Revocation List
Ssl\CrlUrl

Bad class names:

curl
curl_response
HTTPStatusCode
URL
BTreeMap
UserID // User Identifier
CHAR
INTL
SSL\Certificate
SSL\CRL
SSL\CRLURL

Adjusting class & method names added in PHP 8.4

The DOM HTML5 parsing and serialization RFC introduced new class names and method names that violate the updated naming policy, should this RFC be accepted. As part of this RFC, the following changes will be made:

  • The DOM namespace will be renamed to Dom, affecting everything contained within it.
  • DOM\DTDNamedNodeMap -> Dom\DtdNamedNodeMap
  • DOM\HTMLCollection -> Dom\HTMLCollection (Justification: The DOM Standard specifies the name)
  • DOM\CDATASection -> Dom\CDATASection (Justification: The DOM Standard specifies the name)
  • DOM\HTMLDocument -> Dom\HTMLDocument (Justification: Consistency with XMLDocument)
  • DOM\XMLDocument -> Dom\XMLDocument (Justification: The DOM Standard specifies the name)
  • DOM\XPath -> Dom\XPath (Justification: The DOM Standard specifies the XPath interfaces that use this casing)
  • DOM\Implementation::createHTMLDocument() -> Dom\Implementation::createHtmlDocument()
  • DOM\Node::lookupNamespaceURI() -> Dom\Node::lookupNamespaceURI() (Justification: The DOM Standard specifies the name)
  • DOM\*::*NS() -> Dom\*::*NS() (Justification: The DOM Standard generally specifies the NS suffix in this casing)
  • DOM\DocumentFragment::appendXML() -> Dom\DocumentFragment::appendXml()
  • DOM\Document::createCDATASection() -> Dom\Document::createCDATASection() (Justification: The DOM Standard specifies the name)
  • DOM\Document::relaxNGValidate() -> Dom\Document::relaxNgValidate()
  • DOM\Document::relaxNGValidateSource() -> Dom\Document::relaxNgValidateSource()
  • DOM\HTMLDocument::saveXML() -> Dom\HTMLDocument::saveXml()
  • DOM\HTMLDocument::saveXMLFile() -> Dom\HTMLDocument::saveXmlFile()
  • DOM\HTMLDocument::saveHTML() -> Dom\HTMLDocument::saveHtml()
  • DOM\HTMLDocument::saveHTMLFile() -> Dom\HTMLDocument::saveHtmlFile()
  • DOM\XMLDocument::saveXML() -> Dom\XMLDocument::saveXml()
  • DOM\XMLDocument::saveXMLFile() -> Dom\XMLDocument::saveXmlFile()

For the Improve callbacks in ext/dom and ext/xsl RFC the following changes will be made:

  • \DOMXPath::registerPhpFunctionNS() -> \DOMXPath::registerPhpFunctionNS() (Justification: Consistency with the *NS() methods in ext/dom)
  • \DOM\XPath::registerPhpFunctionNS() -> \Dom\XPath::registerPhpFunctionNS() (Justification: see above)
  • \XSLTProcessor::registerPHPFunctionNS() -> \XSLTProcessor::registerPHPFunctionNS() (Justification: Consistency with \XSLTProcessor::registerPHPFunctions(), which unfortunately is inconsistent with \DOMXPath).

Backward Incompatible Changes

Existing class and method names in released versions are not affected, thus there are not backwards incompatible changes. This is a policy RFC.

Proposed PHP Version(s)

Next PHP 8.x (PHP 8.4).

RFC Impact

To SAPIs

SAPIs that expose classes should take the RFC results into account.

To Existing Extensions

Extensions should take the RFC results into account.

To Opcache

None.

New Constants

None.

php.ini Defaults

None.

Open Issues

None.

Unaffected PHP Functionality

Everything that is not a class name of an internal class. Everything that is already in PHP.

Future Scope

None.

Proposed Voting Choices

Adopt the updated class naming policy and adjust the new names introduced in PHP 8.4?
Real name yes no
alcaeus (alcaeus)  
beberlei (beberlei)  
crell (crell)  
devnexen (devnexen)  
dharman (dharman)  
ericmann (ericmann)  
galvao (galvao)  
girgias (girgias)  
ilutov (ilutov)  
kguest (kguest)  
klaussilveira (klaussilveira)  
kocsismate (kocsismate)  
mauricio (mauricio)  
mbeccati (mbeccati)  
nicolasgrekas (nicolasgrekas)  
nielsdos (nielsdos)  
ocramius (ocramius)  
petk (petk)  
ramsey (ramsey)  
saki (saki)  
sergey (sergey)  
theodorejb (theodorejb)  
thorstenr (thorstenr)  
timwolla (timwolla)  
Final result: 23 1
This poll has been closed.

Patches and Tests

Implementation

References

Rejected Features

n/a

rfc/class-naming-acronyms.txt · Last modified: by 127.0.0.1

?
止血芳酸又叫什么名 小孩为什么经常流鼻血 检查膝盖挂什么科 纸尿裤和拉拉裤有什么区别 手脚麻木挂什么科
立秋是什么意思 做亲子鉴定需要什么东西 流鼻血是什么原因引起的 苹可以组什么词 莲蓬什么季节成熟
梦见老婆出轨是什么预兆 covu是什么药 中规中矩什么意思 什么是指 wbc白细胞高是什么原因
后位子宫什么意思 推介会是什么意思 黄体期是什么时候 拿什么让你幸福 佛法是什么意思
欣慰的意思是什么onlinewuye.com 吃猪腰子有什么好处和坏处hcv7jop6ns3r.cn 快递什么时候上班shenchushe.com 梦见老牛是什么意思hcv8jop6ns0r.cn 白色配什么颜色好看0735v.com
什么是珠心算hcv7jop9ns1r.cn 腿疼是什么原因hcv9jop4ns8r.cn 怀孕后壁和前壁有什么区别hcv7jop6ns6r.cn 甘油三酯高吃什么好hcv8jop4ns9r.cn 苍蝇为什么喜欢往人身上飞hcv9jop2ns0r.cn
月经有血块是什么原因hcv9jop0ns1r.cn 谷氨酸钠是什么添加剂hcv8jop6ns2r.cn 梦中梦是什么原因hcv9jop0ns4r.cn 血浓度高是什么原因inbungee.com 红艳煞什么意思hcv7jop9ns6r.cn
嘴歪是什么引起的ff14chat.com 为什么微信运动总是显示步数为0hcv9jop7ns3r.cn 高血压属于什么科hcv9jop1ns7r.cn 做梦梦到对象出轨是什么意思beikeqingting.com 梦到别人怀孕是什么意思hcv8jop5ns9r.cn
百度