Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:116113 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 10797 invoked from network); 21 Sep 2021 03:40:28 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 21 Sep 2021 03:40:28 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 341F91804BD for ; Mon, 20 Sep 2021 21:21:19 -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.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-ot1-f47.google.com (mail-ot1-f47.google.com [209.85.210.47]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 20 Sep 2021 21:21:18 -0700 (PDT) Received: by mail-ot1-f47.google.com with SMTP id 97-20020a9d006a000000b00545420bff9eso19675320ota.8 for ; Mon, 20 Sep 2021 21:21:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=newclarity-net.20210112.gappssmtp.com; s=20210112; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=OwcKhOLBbBoo75Xr2J+qKCIzfQbwZNwZ/biUgXeGUd0=; b=y8H+KqXD97imj5YrHgoKxVSduYAkZ9pjymHq+Yi4RjipBSjKYvFCphvLpe7jqNfluK Npf0K5ecvr3YYMaXFrWJlb7rXp7my5QgfDdtiQ5aRQDJzZw3QM8ZchdtNI4x0WASYdAe lHo7wUkiGD0cpbMOJ67b0PRa3NQZOmP3x4h7+yfiUf8vduFZLCZvtKjvJTz+7xv4hXhi jAcYfTSuCHXUXuE2psTiEB8K+RnLihv/jOPZu7I5NZXkgHYs3OLmquPA9gvxEERerzrQ 7YYFtaXbPY/0HAOiIbkBt/BUeTHtJ2KbQ+0auZl+UN/GgtoYyALzykXOhHjBiDHlUEgO 2gqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=OwcKhOLBbBoo75Xr2J+qKCIzfQbwZNwZ/biUgXeGUd0=; b=vEXkccwIQXATkX+z/Y5r7vZkB5XLm0Cfh6BiTOylrfZN8g98Hoj7QfxgXXUFl8L4xt wSZih+NKh7zz0wu0jIdQbAm3nkviLHYrtqDAVZRuJ7b/muC79utXO929t2Ak/qZNtccX OPunLrblvWvKToEO0kdVsA3YigNOk+bdi7Hn2WLDwE1Vs5nw2dz8ZDTB0gl720e2E0Oa eNKGWrKYewPClplxnoy9HYGwGwU86lqhuUYX0D4foeMbUacLAy6DRwTeFEK/JVl0vtb2 clW9vJGLcekof30eElkEkIhYqZlV5W0FLtFYXVAEQ7So2mvaKvXxjpDpvXkEUU3UzDDo 2TjQ== X-Gm-Message-State: AOAM5339qLbGuzTtPxc3BCN4I2goMAWrSmaIIFoi7fZrn8Ew35EqO3g+ 5EwtrJO+HP+/Vl1ItBFUwodTphlWtjLM4e2E X-Google-Smtp-Source: ABdhPJwk80p7JJMBF6cvCq+S6z9g3HmuCdW935G1kdggFMF85wCI4bYK6Gqksgx1bDTPJNGIy8RgLA== X-Received: by 2002:a05:6830:4489:: with SMTP id r9mr23899310otv.348.1632198074898; Mon, 20 Sep 2021 21:21:14 -0700 (PDT) Received: from [192.168.1.10] (c-24-98-254-8.hsd1.ga.comcast.net. [24.98.254.8]) by smtp.gmail.com with ESMTPSA id t17sm1128546ooe.45.2021.09.20.21.21.13 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Sep 2021 21:21:13 -0700 (PDT) Message-ID: Content-Type: multipart/alternative; boundary="Apple-Mail=_65A0EA16-39E4-419E-B5C2-769FA72A9DD2" Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\)) Date: Tue, 21 Sep 2021 00:21:12 -0400 In-Reply-To: Cc: "internals@lists.php.net" To: tyson andre References: X-Mailer: Apple Mail (2.3608.120.23.2.7) Subject: Re: [PHP-DEV] Adding `final class Deque` to PHP From: mike@newclarity.net (Mike Schinkel) --Apple-Mail=_65A0EA16-39E4-419E-B5C2-769FA72A9DD2 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Sep 19, 2021, at 8:03 PM, tyson andre = wrote: >=20 > Hi internals, >=20 > I've created a new RFC https://wiki.php.net/rfc/deque to add a `final = class Deque` >=20 > This is based on the `Teds\Deque` implementation I've worked on > for the https://github.com/TysonAndre/pecl-teds PECL. With one caveat, this is a much stronger RFC than the Vector one. Good = job! However... > On Sep 20, 2021, at 4:25 PM, Rowan Tommins = wrote: >=20 > On 20/09/2021 14:46, tyson andre wrote: >> The choice of global namespace maintains consistency with the = namespace used for general-purpose collections already in the SPL >=20 > I find this argument unconvincing. If the intention is for this to fit = with existing classes in the SPL, it should be called "SplDeque", or = more consistently "SplDoubleEndedQueue", and the RFC should talk about = how the design aligns with those existing classes. >=20 > If it is intended to be the first of a new set of data structures = which are *not* aligned with the existing SPL types, then putting it in = a new namespace would make most sense. >=20 > In the RFC and the list you've mentioned a few comparisons, but I = don't think any of them hold: >=20 > * ArrayObject, WeakReference, and WeakMap are all classes for binding = to specific engine behaviour, not generic data structures > * Iterators all have an "Iterator" suffix (leading to some quite = awkward names) > * Reflection classes all have a "Reflection" prefix > * Having both "Queue" and "SplQueue", or both "Stack" and "SplStack" = would be a terrible idea, and is a pretty strong argument *not* to add = data structures with such plain names I am in complete agreement with Rowan. =20 Honestly, at first I confused `Deque` with `Dequeue` and was wondering = why we would name a class with a verb? It wasn't until Rowan's comment = that I realized `Deque` is an abbreviation. =20 Which begs the question: how many other PHP developers will know = computer science terms like this well enough to know `Deque` is a noun = when they see it, and more importantly how many PHP developers will = think to search for `Deque` when they need a queue? So here is a straw man argument; name the class one of: - DataStruct\DoubleEndedQueue, or - DataStruct\DE_Queue Let the bike-shedding begin!=20 (Or is that "Let it continue?") -Mike P.S. BTW re: https://github.com/TysonAndre/pecl-teds = , who is Ted? (pun intended)= --Apple-Mail=_65A0EA16-39E4-419E-B5C2-769FA72A9DD2--