Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:122995 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id 36C261A009C for ; Sat, 6 Apr 2024 12:55:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1712408189; bh=H1ARUaHELkfFglI3EAD7IO+BlusPaC6HiWonxQEUp8o=; h=Date:Subject:To:References:From:In-Reply-To:From; b=O1oFhQLY8OfGFeBg68sl/tIN4s6yjY14eaHom22EWnwYUcPROMS36oqGlZJbeyWph UpCgtLKpqiZTGdd4qVsH9XV5e118Fm1GQQtT6VNZXbTQxq22I5gbdkI7/+Cnw/Q7Gn Y1wN/GvaOoZe8G5kpxUogKjjoCm/tp1FCZ5AvxmGCUMcW+HwXA7IjAnOMfO8Vijyig 6eb5i/yCUafWI3tXW+VkjioTqTASgDRNow6YRU0h/d+yjHLajsjmDYNuxSCILb1WIO OlhWZMLltSm22XhAF4AfI/YtK7cpFxIL5sbZpGSm4mUNvXDD+Ed6j9u4B3NFlSaSbI c/SV75CviCUBw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 1B5C018005D for ; Sat, 6 Apr 2024 12:56:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from chrono.xqk7.com (chrono.xqk7.com [176.9.45.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sat, 6 Apr 2024 12:56:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1712408155; bh=lZKJzXTJk8TQbzKPgZp8IhAtIlwpN+3wrzE8VGFDJ5M=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type:from:to:cc:subject:message-id; b=N910nBFiOnrxweNf7Wl0+XzRA98zZLzXWfgSLBvwwxOJ4I5sTe5g7O5n+G+Ijy+Ky d6/xdTDquWh4+eWtxaR5wVQxHtT6TCvqhSL6TuD1pZJffVkSOwfmdHnxeDpppsbOAB 17x1GJ62Q0RQ8ZrimmJFGSdTgKOdGxzAKdm/9XYwh/HchNkB29fZKdZbSnXDQZwF3j +0qYNSEt0UaxlLYUzbnhwc8RR2EjR4hckynPDkwqopJXxAJLChT6tpES2mEd41tPbS e2uIo0BUnLpabGR7vf6xd5gVPAStKhDSpsmpyW04MNiCWNZhv1fnFA8/p/nlTYB2ed bPH5c5WmOFNiw== Message-ID: <2eb57476-1952-44f7-8408-762faa4f5971@bastelstu.be> Date: Sat, 6 Apr 2024 14:55:53 +0200 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 Subject: Re: [PHP-DEV] [RFC] Casing of acronyms in class and method names To: Juliette Reinders Folmer , internals@lists.php.net References: <792b2282-b7a3-40dd-899c-daab55353316@bastelstu.be> <69107662-eb03-4b75-8eed-59dd2eed6559@gmail.com> <66103C7A.3040906@adviesenzo.nl> <80ac7108-e016-4ae8-87ad-50afa0c2f257@bastelstu.be> <37f1b0c6-a7c8-41f3-bf2f-7dd466bb31c9@app.fastmail.com> <66106DDF.6050308@adviesenzo.nl> Content-Language: en-US In-Reply-To: <66106DDF.6050308@adviesenzo.nl> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit From: tim@bastelstu.be (=?UTF-8?Q?Tim_D=C3=BCsterhus?=) Hi On 4/5/24 23:32, Juliette Reinders Folmer wrote: > I also took the liberty to ask accessibility expert Nicolas Steenhout > [1] for his opinion on this topic and he has given me permission to > quote his reply: > > > From a human readability and an accessibility perspective, Camel Case > are best when words are concatenated like that. > > The rule I’d use here is uppercase the first letter of a word. Then > lowercase the others. Unless you are writing an acronym. > > So in your example, it should be `PerformHTTPRequest()` > > The underscore becomes a problem because if for some reason we’re > writing code as an example and it gets underline for any reason, the > underline gets lost > Thank you. I must admit I find it a little hard to interpret the answer without also seeing the corresponding question, because the way the question was phrased might've influenced the answer. While I personally disagree with the acronym casing, it is not too bad in the example identifier used ("Perform HTTP Request"). However the naming policy will not just need to make the average case look great, but also make the worst case look acceptable. If it cannot do so and needs exceptions, then it failed to be a useful policy. Hoping it isn't too much of a request, would you mind asking Nicolas whether the answer changes, when facing the following extreme examples consisting of consecutive acronyms. I'm intentionally writing them in their natural casing with spaces to hopefully not influence the response: 1. PCG Oneseq 128 XSL RR 64 which for reference is "Permuted Congruential Generator One Sequence 128-Bit state XorShift Low Bits Random Rotation with 64-Bit Output", with the abbreviations / acronyms matching the naming in the reference implementation / corresponding paper. 2. PDO ODBC which is "PHP Data Object Open Database Connectivity", but no one writes those acronyms out in full. 3. XML HTTP Request which is "eXtensible Markup Language HyperText Transfer Protocol Request". I'd argue that the name is not really descriptive in the first place, but it's another existing real-world example. 4. UUID v4 Taken from Ben Ramsey’s UUID library: https://github.com/ramsey/uuid/tree/4.x/src/Rfc4122 5. S3 Client as in "Amazon Simple Storage Service Client". Taken from Flysystem: https://github.com/thephpleague/flysystem/blob/3.x/src/AwsS3V3/S3ClientStub.php Best regards Tim Düsterhus