Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123008 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 4A9701A009C for ; Sun, 7 Apr 2024 04:37:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1712464666; bh=26FhPWgCUf1X9L6TCZAYyWWPxGJuJCZh9eXq1OL8Hsg=; h=Subject:To:References:From:Date:In-Reply-To:From; b=cZx1i14Ahaf4CzGyx6HX+LhZ+6anxovj3gwmou3nGrbRJV4C8OSTVg91CR2wHBp5q qYipULH7ehVr+I9ZXZfQcrO3bUAFXDE80dr8rh5wfBtzvzbX8oKiiy43TS255818FR jgAc9UyAGsJjhp65rAp3sudIIxPgOPSbQtUI6nJ5/p/gC6eGm+NiTT4/Hn1NTWkVMc dMTdIwdvqwGpZ6+wgNsWdgZH7OmXZ2bfleHlzHpTaDsFXi7WgfrOipmPEoC9BjfTvY DcUPqPmOThQkL1EGmt7LppZh9meatimIwesxj+dFMZtwyQ5ilgptk0kn+b/WsHpK5K FuNpb9CeBrbMA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 5687F180061 for ; Sun, 7 Apr 2024 04:37:45 +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=1.2 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_40, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING, HTML_MESSAGE,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_SOFTFAIL,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from dragonfly.birch.relay.mailchannels.net (dragonfly.birch.relay.mailchannels.net [23.83.209.51]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sun, 7 Apr 2024 04:37:44 +0000 (UTC) X-Sender-Id: a2hosting|x-authuser|juliette@adviesenzo.nl Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id AB7FE100F3E for ; Sun, 7 Apr 2024 04:37:12 +0000 (UTC) Received: from nl1-ss105.a2hosting.com (unknown [127.0.0.6]) (Authenticated sender: a2hosting) by relay.mailchannels.net (Postfix) with ESMTPA id 74CEA100F0E for ; Sun, 7 Apr 2024 04:37:11 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1712464631; a=rsa-sha256; cv=none; b=x/pcMki6u4Tm8GWEdySaLTGCpjhDPMEjvFh4JHPDyUyM9WwJNXL1pbUMg/G2r+e7zTBEQL mBKr7/U9fMRyYelpFbWAfRfFcsQpTIJHLToj5LqHQTC1qVIG4yn427Vtmi2//j1EfyBQZh pZyP/2wB04JNud8+5hPlU87qBN25bhCRCtlhxBqoZYmlo5Zsluxy4Rpq1DS3TZMmfAH4ZE zyKK5C/E0yMNDiP1pnuZl0WmRoQo1Vnorco2ylr7bjzHCgZSfBh2VRL40vmXD6+ZCSQqZx PSOPiVw69SUKNDsD17OvVRsD88EbMsrwnS0bkmG7RyjHjTbiGnvZ5yweq3dZFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1712464631; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:dkim-signature; bh=8dCCPuKYxnUoOHQZCG/TdRw9jpGlfa7OsD5a24LEiPc=; b=6pYFHvdGhcodJza1SNObXanExLUoM/6uvSZ5Jwq6ku8t8HQgFWgedjP9fdWBRlRZPOqZXn Xaov46Ey2wIb3uB0znrPqfbO/N4pTF6ePMD6mGt8c6HTmbwQcAYg5s9xeBu1HwGX/j98vi nOTw21qvWsXGIvZ6x5aIIvPBtu6DIEvEWPHOf4c07yIMWP/vMnARPwOMar5H9AaQJ4yl3m wSxSypl1YW7WLpzUj8op86G+KM5NVyPa1W6KrC8mPzyE5r3PbuC1Y0EqL17CKJSHSiH1dO zbyAaQKxO4sg+nt2Z/kdHP3SaEsthFRynhKu+ZBOpVhNRnuKXg3okJsqgg5FMw== ARC-Authentication-Results: i=1; rspamd-687b9dd446-g9xfh; auth=pass smtp.auth=a2hosting smtp.mailfrom=php-internals_nospam@adviesenzo.nl X-Sender-Id: a2hosting|x-authuser|juliette@adviesenzo.nl X-MC-Relay: Neutral X-MailChannels-SenderId: a2hosting|x-authuser|juliette@adviesenzo.nl X-MailChannels-Auth-Id: a2hosting X-Keen-Gusty: 6775f1051d6594b7_1712464632020_4052202833 X-MC-Loop-Signature: 1712464632019:2946818384 X-MC-Ingress-Time: 1712464632019 Received: from nl1-ss105.a2hosting.com (nl1-ss105.a2hosting.com [85.187.142.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.117.91.86 (trex/6.9.2); Sun, 07 Apr 2024 04:37:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=adviesenzo.nl; s=default; h=Content-Type:In-Reply-To:MIME-Version:Date: Message-ID:From:References:To:Subject:Sender:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=8dCCPuKYxnUoOHQZCG/TdRw9jpGlfa7OsD5a24LEiPc=; b=cvYfVTLVIr5zWr6zeIUXGXaakJ pPH4n065HvmvLNCiOy51a8riUXQyRuVjWFuD8h7YQCMV4y2eX4kOiFS1Z25oC6OxwaE8u2To4WOhD LPThf2BMM0mnEDLgbvHIVMWziyWCrs4XpO8WQr2Bzo6Fd+sHiz3TyKM+66n3Ad0Nx1Zo=; Received: from mailnull by nl1-ss105.a2hosting.com with spam-scanner (Exim 4.96.2) (envelope-from ) id 1rtKHF-00A94i-25 for internals@lists.php.net; Sun, 07 Apr 2024 06:37:09 +0200 X-ImunifyEmail-Filter-Info: X0RSVUdTX01NX1BST05PVU5DRSBSQ1ZEX1ZJQV9TTVRQX0FV VEggUkN WRF9UTFNfQUxMIFZFUklMT0NLX0NCIFJDVkRfQ09VTlRfT05FIEJBWU VTX0hBTSBNSU1FX1VOS05PV04gQVJDX05BIE1JRF9SSFNfTUFUQ0hfR lJPTSBJRV9WTF9QQkxfQUNDT1VOVF8wNSBNSU1FX1RSQUNFIEZST01f RVFfRU5WRlJPTSBGUk9NX0hBU19ETiBUT19ETl9OT05FIFJDUFRfQ09 VTlRfT05FIElFX1ZMX1BCTF9BQ0NPVU5UXzAxIFRPX01BVENIX0VOVl JDUFRfQUxMIF9EUlVHU19NTV9ESVNDT1VOVCBBU04= X-ImunifyEmail-Filter-Action: no action X-ImunifyEmail-Filter-Score: 0.79 X-ImunifyEmail-Filter-Version: 3.5.10/202404052205 Received: from [143.178.154.86] (port=58021 helo=[192.168.1.16]) by nl1-ss105.a2hosting.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96.2) (envelope-from ) id 1rtKHF-00A93d-1C for internals@lists.php.net; Sun, 07 Apr 2024 06:37:09 +0200 Subject: Re: [PHP-DEV] [RFC] Casing of acronyms in class and method names To: 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> <2eb57476-1952-44f7-8408-762faa4f5971@bastelstu.be> Message-ID: <661222EE.3050303@adviesenzo.nl> Date: Sun, 7 Apr 2024 06:37:02 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 In-Reply-To: <2eb57476-1952-44f7-8408-762faa4f5971@bastelstu.be> Content-Type: multipart/alternative; boundary="------------050008070003080005020206" X-AuthUser: juliette@adviesenzo.nl From: php-internals_nospam@adviesenzo.nl (Juliette Reinders Folmer) This is a multi-part message in MIME format. --------------050008070003080005020206 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 6-4-2024 14:55, Tim Düsterhus wrote: > 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 > Hi Tim, I forwarded your questions from above verbatim to Nicolas and this was his response (also quoted verbatim): > So, this one is interesting. > Sure, if you look at these extremes, stringing them back to back all in a uppercase, they are not particularly user-friendly to read. > Then again, none of these solutions are super user-friendly. We are dealing with making the best of things. > I have to say, it always gets my goat a little bit when people raise “the extremes” in the context of accessibility. Somehow it always ends up feeling like, to me at least, like a copout. > Like, sure if you have someone who is blind, deaf, and paralyzed from a stroke, making something accessible to them is going to be extremely difficult. It doesn’t mean you shouldn’t make things accessible to people who are blind, to people who are deaf, and to people who are paralyzed from a stroke. > This is a little bit like that. The solution I proposed earlier may not work for everybody. But it will work for a majority. Smile, Juliette --------------050008070003080005020206 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit
On 6-4-2024 14:55, Tim Düsterhus wrote:
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


Hi Tim,

I forwarded your questions from above verbatim to Nicolas and this was his response (also quoted verbatim):

> So, this one is interesting.
> Sure, if you look at these extremes, stringing them back to back all in a uppercase, they are not particularly user-friendly to read.
> Then again, none of these solutions are super user-friendly. We are dealing with making the best of things.
> I have to say, it always gets my goat a little bit when people raise “the extremes” in the context of accessibility. Somehow it always ends up feeling like, to me at least, like a copout.
> Like, sure if you have someone who is blind, deaf, and paralyzed from a stroke, making something accessible to them is going to be extremely difficult. It doesn’t mean you shouldn’t make things accessible to people who are blind, to people who are deaf, and to people who are paralyzed from a stroke.
> This is a little bit like that. The solution I proposed earlier may not work for everybody. But it will work for a majority.

Smile,
Juliette
--------------050008070003080005020206--