Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:116112 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 5525 invoked from network); 21 Sep 2021 01:38:16 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 21 Sep 2021 01:38:16 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id F3E2C1804BD for ; Mon, 20 Sep 2021 19:19:06 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_HOTMAIL_RCVD2, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS8075 40.80.0.0/12 X-Spam-Virus: No X-Envelope-From: Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11olkn2079.outbound.protection.outlook.com [40.92.18.79]) (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 ; Mon, 20 Sep 2021 19:19:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OlAjKI0ViObt25n29S8YVYk74rHzKtctJz2myMhZsXhzTa0h7QnAjjvJQHAEaqQm9jIJyGrgJcfU+iHiH1UkPL+hnZ/3TvG1zjPmQv3wi87zBljLcmIEPsXObuv5hmj/NaTh0kBcX8LFaRe9tXgswMClXg6W+jsMsXUmlSeJytyDAj8OgY09zMvCy2bFk1XHP7xV0JgBUCtQUM5OHWkDnVwc8m8rlI6pjzqZ93fliaPhtoT2YHP4LVtfbSnPLWbZ2ybRPRgM3nOuAW3EtISLqI89yWni2SxqJqezaFQnt+od4kMlbPRc9SaZI7zFO2jEDAhDDbVjIQs/U0I8/HyySg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=A3jr69PS82ugQtUbCoTkPk56U42vxtbKlwIvueRKDts=; b=Xh3tg1npEhN+Te7LtxkAV95ie1BxcYdnBdZQTw3CXOCkxJaAP4zHGxfsbui7vFtxaxiu4zQvhfSK5mQkLN4w2/st2asHjDwQj/08Q/1SE/5IwWKRGdnBRK+UhBJbnBmZgh/4nTI/f3SIAqUilQ419yblWuoLUmsLCfjkxCqJoLIqaK/KwGFYwvoU9dNA9jWYy4JMW2pnlDj3aGxIjvAKCotYzZ/DledVY0TjEzrrPogY4lnQISa2XvuUrsvNhtVoaNUGoa3Pc/dNofTW7J8O4/Wu8LHgSx3FD0t2Xyqd2gQo1AHSXMdsQhSKvZhm6RsVjNvlOcE2F8BdvrJa38ccVg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=A3jr69PS82ugQtUbCoTkPk56U42vxtbKlwIvueRKDts=; b=J7dRnlfXbXhJpOG/UNKBejafmp4a8XeBfOUsnQBqWsS2HpKSgmXyxMiYcKWoHIhEzYU6iAXe2RDKFmPZyfl9OwR2S7sfYZce7c2ECztsLI3a4kfWgMFtHG860eHOg5UsCQAQmLML6w8RA2pMyGpQjkXimCyQD7UGq7dbLUOlUW3ag3cf/qSpctiI7YhaYi7gHBMkCqUB1juLlahE0NKCU1/mkitQePtyxM0VRfP25XIDjU0GfwJo86WmMkzj3wfcV3txnlx86FXWB0Di4SPCOAEAbvUZtcvdWTPJAnm2hU+C0uM+6ttC7Q5ow9iw08RGaOLcyypDScZpeYN0VdIiaA== Received: from DM6PR07MB6618.namprd07.prod.outlook.com (2603:10b6:5:1cf::26) by DM6PR07MB4171.namprd07.prod.outlook.com (2603:10b6:5:c9::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.17; Tue, 21 Sep 2021 02:19:03 +0000 Received: from DM6PR07MB6618.namprd07.prod.outlook.com ([fe80::7181:60db:c4d2:835]) by DM6PR07MB6618.namprd07.prod.outlook.com ([fe80::7181:60db:c4d2:835%7]) with mapi id 15.20.4523.018; Tue, 21 Sep 2021 02:19:03 +0000 To: "internals@lists.php.net" Thread-Topic: (Planned) Straw poll: Naming pattern for `*Deque` Thread-Index: AQHXroS7YGugvAukqkKHqJ49b74ipg== Date: Tue, 21 Sep 2021 02:19:03 +0000 Message-ID: Accept-Language: en-CA, en-US Content-Language: en-CA X-MS-Has-Attach: X-MS-TNEF-Correlator: suggested_attachment_session_id: f98e8adc-3142-91c1-15d7-d5c5b2d89ea1 x-tmn: [a6yW15dGHTtgWmPtnSGM2QSzalPLx7OM5VlHAxK8v7Iou8gwcXJOFmgQbJyGw7xaZIryHEgXcws=] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b0013d8b-9750-4735-2dcc-08d97ca62e66 x-ms-traffictypediagnostic: DM6PR07MB4171: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: mtNQdM6pbwIL9L++PJBOJRWlC9q4sArdXHnPMVxIMip09LPIEf5f4HVODqEvRpd+GhUVacqbbdZa9Gle2U9DMWs3L7DouHC+byWN1nsp2XYYAilb8Gz9RCBtmBNVKLfpHc1ZnPqDF+BoeAF0oeCEXjXUT6SxZ1tHPOcSWoup7zgjOSVj/gY23NoFylTm2vgLdVQnU/JrISw9UYYALA04SROg1PbSdHmZdSkkv/d8aZuV0d3+/YY2GVXyaPkuSAXL/YpumRLEl6ye47z/z3zMMqfpuxYPPZcYiG9jB2SqiHRnzYgSd3F4zY3sKGICT7sUkI4uJMb4nElSMrPtVAX7dsZ2z/rMFZjylDtYZFV6jhH0fHE9mY5sPyUlhPOUAxASb5TXgqC87udbapR9ORQmsHY7pggR7ciGwUAsrlBwnR3SBTPuufkjvosaV/R3qWSsDXR4OgJZdz/Tpd0HteCJkh/PYn4rNX6nHbJN6AcRk2A= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: s5Aoh7q0+USKtzQdVSI4dMeJWnirWLUsWk97pdVQNTCURmGAfJ20HG0NtxyTQ3O20Om5ZxQ6u0ciNVdzz4l+ibKc8h5uRTAH5DSpHbegbPNPo65etPoli0G6FbdGq7SeK5ZKenPJAioP2tscbW12UHj0UPjA0TrScoHR6hJMWNJ0wJCYZGhn3t+WJX2dvf2IXoVH5GT34yUJuud6oIhoFw== x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: sct-15-20-3174-20-msonline-outlook-35401.templateTenant X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR07MB6618.namprd07.prod.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: b0013d8b-9750-4735-2dcc-08d97ca62e66 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Sep 2021 02:19:03.3520 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR07MB4171 Subject: (Planned) Straw poll: Naming pattern for `*Deque` From: tysonandre775@hotmail.com (tyson andre) Hi internals,=0A= =0A= Because the naming choice for new datastructures is a question that has bee= n asked many times,=0A= I plan to create another straw poll (Single transferrable vote) on wiki.php= .net to gather feedback on the naming pattern to use for future additions o= f datastructures to the SPL,=0A= with the arguments for and against the naming pattern.=0A= =0A= https://wiki.php.net/rfc/namespaces_in_bundled_extensions recently passed.= =0A= It permits using the same namespace that is already used in an extension,= =0A= but offers guidance in choosing namespace names and allows for using namesp= aces in new categories of functionality.=0A= =0A= The planned options are:=0A= =0A= 1. `\Deque`, the name currently used in the RFC/implementation. See https:/= /wiki.php.net/rfc/deque#global_namespace=0A= =0A= This was my preference because it was short, making it easy to remember = and convenient to use.=0A= 2. `\SplDeque`, similar to datastructures added to the `Spl` in PHP 5.3.=0A= =0A= (I don't prefer that name because `SplDoublyLinkedList`, `SplStack`, and= `SplQueue` are subclasses of a doubly linked list with poor performance,= =0A= and this name would easily get confused with them. Also, historically, n= one of the functionality with that naming pattern has been final.=0A= However, good documentation (e.g. suggesting `*Deque` instead where poss= ible in the manual) would make that less of an issue.)=0A= =0A= See https://wiki.php.net/rfc/deque#lack_of_name_prefix (and arguments fo= r https://externals.io/message/116100#116111)=0A= 3. `\Collection\Deque` - the singular form is proposed because this might g= row long-term to contain not just collections,=0A= but also functionality related to collections in the future(e.g. helper = classes for building classes=0A= (e.g. `ImmutableSequenceBuilder` for building an `ImmutableSequence`), g= lobal functions, traits/interfaces,=0A= collections of static methods, etc.=0A= (especially since https://wiki.php.net/rfc/namespaces_in_bundled_extensi= ons prevents more than one level of namespaces)=0A= =0A= Additionally, all existing extension names in php-src are singular, not = plural. https://github.com/php/php-src/tree/master/ext =0A= (Except for `sockets`, but that defines `socket_*` and `class Socket` an= d I'd assume it would be named `Socket\` anyway, the rfc didn't say exactly= match?)=0A= =0A= So the namespace's contents might not just be `Collections`, but rather = all functionality related to a `Collection`)=0A= Also, the examples in the "namespaces in bundled extension" RFC were all= singular=0A= =0A= > For example, the `array_is_list()` function added in PHP 8.1 should in= deed be called `array_is_list()`=0A= > and should not be introduced as `Array\is_list()` or similar.=0A= > Unless and until existing `array_*()` functions are aliased under an A= rray\* namespace,=0A= > new additions should continue to be of the form `array_*()` to maintai= n horizontal consistency.=0A= =0A= See https://wiki.php.net/rfc/deque#global_namespace (and https://externa= ls.io/message/116100#116111)=0A= =0A= Also, straw polls for other categories of functionality (https://wiki.ph= p.net/rfc/cachediterable_straw_poll#namespace_choices) =0A= had shown interest of around half of voters in adopting namespaces,=0A= there was disagreement about the best namespace to use (e.g. none that w= ere preferred to the global namespace),=0A= making me hesitant to propose namespaces in any RFC. For an ordinary col= lection datastructure, the situation may be different.=0A= =0A= While there is considerable division in whether or not members of internals= want to adopt namespaces,=0A= I hope that the final outcome of the poll will be accepted by members of in= ternals =0A= as what the representative of the majority of the members of internals =0A= (from diverse backgrounds such as contributors/leaders of userland applicat= ions/frameworks/composer libraries written in PHP,=0A= documentation contributors, PECL authors, php-src maintainers, etc. (all of= which I expect are also end users of php))=0A= want to use as a naming choice in future datastructure additions to PHP.=0A= (and I hope there is a clear majority)=0A= =0A= -----=0A= =0A= Are there any other suggestions to consider for namespaces to add to the st= raw poll?=0A= =0A= Several suggestions that have been brought up in the past are forbidden by = the accepted policy RFC (https://wiki.php.net/rfc/namespaces_in_bundled_ext= ensions)=0A= and can't be used in an RFC.=0A= =0A= - `Spl\`, `Core\`, and `Standard\` are forbidden: "Because these extensions= combine a lot of unrelated or only tangentially related functionality, sym= bols should not be namespaced under the `Core`, `Standard` or `Spl` namespa= ces.=0A= Instead, these extensions should be considered as a collection of differe= nt components, and should be namespaced according to these."=0A= - More than one namespace component (`A\B\`) is forbidden=0A= - Namespace names should follow CamelCase.=0A= =0A= Thanks,=0A= Tyson=0A=