Re: Casing of acronyms in class and method names
| From: | Lynn | Date: | Wed, 30 Aug 2023 11:58:18 +0000 |
| Subject: | Re: Casing of acronyms in class and method names | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-120960@lists.php.net to get a copy of this message | ||
On Wed, Aug 30, 2023 at 1:44 PM Tim Düsterhus <tim@bastelstu.be> wrote:
> Hi
>
> 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:
>
> [...]
> 2. It decreases readability.
>
> Especially 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..
>
Thanks for bringing this up as readability is indeed an issue for me with
all caps acronyms. I would much prefer Acronyms to be treated as words as
this is how most people seem to use them anyway.