Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:113133 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 98236 invoked from network); 10 Feb 2021 16:29:16 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 10 Feb 2021 16:29:16 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 1DE031804E1 for ; Wed, 10 Feb 2021 08:14:32 -0800 (PST) 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,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-qk1-f173.google.com (mail-qk1-f173.google.com [209.85.222.173]) (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 ; Wed, 10 Feb 2021 08:14:31 -0800 (PST) Received: by mail-qk1-f173.google.com with SMTP id m144so2135350qke.10 for ; Wed, 10 Feb 2021 08:14:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=newclarity-net.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=E8ACVJ+r+ZcP6DXBXEhzhHE5BEzwJvi63AeRQfNAtXM=; b=tgfj0NpGM8SCGl35MtQaV4mhF5QZDqSWfrwLF4yeO4uWjTMg7ImbDvH5zXOEFahGHk kTbAhsHC7w9+5exv4cdJlrOUVxkRR2SRbNHLdJkSyQ8Aj6OTLmCk1zNmbFc/iKEUOqx+ 8F8Jpg8QUgq8ZadZKXNXrGStnlwLnHwA8LjSw058MPZ5VlyE8tUv65ul1qBQqht+3Zk1 gHHn4OFto4Kzq8XXiWZVjatoYs0+c8jkhnpGkMjkKOkm0tp4E4ama01UKf99bcvAMMGs R791gwY3gnfyD3Nt5YlZ4tFZbFFsalaqDRtOswBiUU2xSLLvFmPVkDyC8IZSU13/AHEt 3WdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=E8ACVJ+r+ZcP6DXBXEhzhHE5BEzwJvi63AeRQfNAtXM=; b=pQuHdDzXJa4GB5ERUZJsiumWm+fCOG/nKVgR4zN1qDK+MX5K4O7mJG4vDj4B0r8aqW sRIQk7YNomD+anNqgBw8F8FIm/guoAwPrCwA+mTRQkoMusb7AbP1pULvwSBk7zB45yvb gIX4H2dYh+J9j2Cgwg65FzGPyuaecdC2McGQ+Hssuari1SkSw2Gd2DyjT8JpD0YzNSHI YmZtNSC7F9sqdi2BqRFZccqZa5gInXjA4xDfr/gWmr2eH3laeP2dCF8PnRgUduegx7OD M/mX1d0d9mZ3tYf6ECPrAeK9iAy9Ysm6l4EiiXTZD2HGim7n5i/ZPXdpHJyo7YwVxQig 81qw== X-Gm-Message-State: AOAM531ZLgUA7mwt8a129CxbAwM8H4kN5jzpAlu6H9Jw5MnyGPNekFC/ DUpjmvq353+eQTqE4Y5t+/QJVw== X-Google-Smtp-Source: ABdhPJwAct7UbJXmhH/GNB4iddVBAvEFB9RRSCT6BHvIbBivEHmIp8CYS0GF0TOFLBTlgg/p5/M0aQ== X-Received: by 2002:a37:e13:: with SMTP id 19mr4072799qko.119.1612973669685; Wed, 10 Feb 2021 08:14:29 -0800 (PST) Received: from [192.168.1.239] (c-24-98-254-8.hsd1.ga.comcast.net. [24.98.254.8]) by smtp.gmail.com with ESMTPSA id s60sm1436212qtd.16.2021.02.10.08.14.29 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Feb 2021 08:14:29 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) In-Reply-To: Date: Wed, 10 Feb 2021 11:14:28 -0500 Cc: PHP internals Content-Transfer-Encoding: quoted-printable Message-ID: References: <77dfe9e5-a6d1-4a41-bceb-454a65cf34d0@www.fastmail.com> To: Kamil Tekiela X-Mailer: Apple Mail (2.3608.120.23.2.4) Subject: Re: [PHP-DEV] [VOTE] PHP\iterable\any() and all() on iterables From: mike@newclarity.net (Mike Schinkel) > On Feb 8, 2021, at 7:37 PM, Kamil Tekiela = wrote: >=20 > Hi Tyson, >=20 > Thanks for the RFC. I have to say that I like the core concept and the > motivation behind it. However, let me explain why I voted No. >=20 > 1. As others have said I think that the scope is too small. If we are = going > to create that namespace then I would like to see more = functions/classes in > that namespace. > 2. I don't like the name. I know the namespace might provide some = guidance > of what the function is, but namespaces are often imported. What we = are > left with in the code is then `any()`/`all()` that doesn't have a > self-describing name. any_values is better but still doesn't describe = the > action that the function will take. I am a strong believer that = methods and > functions should be called with verbs which describe an action. e.g. > search, filter, combine, merge, etc. There can always be exceptions = but > there should be a good reason to justify such an exception. Having self-describing function names is a good policy for userland = code. However, and piggybacking on what Larry Garfield just wrote, for = language primitives that will be used often by many developers and that = have analogues in other languages, having short names works well.=20 By definition there are not tons of language primitives like these for = developers to learn, at least not when compared to userland code, and = their shortness empowers developers to write more concise code. -Mike=