Re: Casing of acronyms in class and method names
| From: | Ben Ramsey | Date: | Sun, 10 Sep 2023 23:57:30 +0000 |
| Subject: | Re: Casing of acronyms in class and method names | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-121034@lists.php.net to get a copy of this message | ||
On 8/31/23 13:34, Niels Dossche wrote:
Attachment: [application/pgp-signature] OpenPGP digital signature OpenPGP_signature.asc
Hi Tim On 30/08/2023 13:43, Tim Düsterhus wrote:I agree. Using uppercase for the first letter in an acronym and lowercase for subsequent letters appears to be prevalent in many userland libraries, so it seems to be what users expect. Since class names in PHP aren't case-sensitive, there should be no BC concerns for changing existing classes to fit this new casing (for Reflection, debug, and documentation purposes). That is, if we wanted to also update all existing class names in PHP that contain acronyms (e.g., DOMDocument -> DomDocument, SimpleXMLElement -> SimpleXmlElement, etc.). -- Cheers, BenHi after suggesting the use of ucfirst(strtolower(...)) casing for acronyms within a classname of a draft RFC, I was made aware of previous class naming RFC (June 2017) that required the use of PascalCase for class names, with the exception of acronyms which must be completely uppercased: https://wiki.php.net/rfc/class-naming I'd like to propose to revisit this earlier decision for the following reasons. Before writing an RFC I'd like have some pre-discussion to gauge opinions. -------------------- 1. It is not consistently applied: [...]I think it's a good idea to change the rules to reality as much as possible. Especially given that recent additions seem to follow what you're proposing.
Attachment: [application/pgp-signature] OpenPGP digital signature OpenPGP_signature.asc