Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:113132 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 95738 invoked from network); 10 Feb 2021 16:05:57 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 10 Feb 2021 16:05:57 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 328771804E1 for ; Wed, 10 Feb 2021 07:51:09 -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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, RDNS_NONE,SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from out5-smtp.messagingengine.com (unknown [66.111.4.29]) (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 07:51:08 -0800 (PST) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 1C8AA5C0214 for ; Wed, 10 Feb 2021 10:50:58 -0500 (EST) Received: from imap8 ([10.202.2.58]) by compute4.internal (MEProxy); Wed, 10 Feb 2021 10:50:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=4nFp3M pcpd5qUH6/S+9Kr/sJR/uxw4mFE47svfCFpVA=; b=rVphiVu+S3pa2zK3zxcL+3 0Y6qfoAHdhaH7+m1xo5PeWIxG5DZ38NpT/iY/dxuP8Ooe2+uxFjQZav0k5xC/lUd xQxLoExA42gRwk5JZNWjK+iTCm1LKfXpwhDXLlaD0ZFYiAzlEppd6mA5dTjTs7GE 8lFW1YESwKs4VrblxJ1FzWdJyqcnsQLQ3H4Md3VjZxQCf65+ABR10fgsHPXCk0b+ WnAc2Sq99bRCV7lvatq2iHDPyZjkj5JECGm4boj7Ng2Z1/haLeV0XY5CHpJxEFKF 5yGvpCVkphvUowodJnKEfYuZde5FXBrsqtbmEwcRtn76KilV3AYB26zrN7CF0l+g == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrheejgdektdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvufgtsehttdertderredtnecuhfhrohhmpedfnfgrrhhr hicuifgrrhhfihgvlhgufdcuoehlrghrrhihsehgrghrfhhivghlughtvggthhdrtghomh eqnecuggftrfgrthhtvghrnhepgeelgfekudeivddvteffueejffdthfejieevhefgffek udevkedtvdelvddvffefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg hilhhfrhhomheplhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtohhm X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id A4DA43A0074; Wed, 10 Feb 2021 10:50:57 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-93-gef6c4048e6-fm-20210128.002-gef6c4048 Mime-Version: 1.0 Message-ID: In-Reply-To: References: <77dfe9e5-a6d1-4a41-bceb-454a65cf34d0@www.fastmail.com> Date: Wed, 10 Feb 2021 09:50:37 -0600 To: "php internals" Content-Type: text/plain Subject: Re: [PHP-DEV] [VOTE] PHP\iterable\any() and all() on iterables From: larry@garfieldtech.com ("Larry Garfield") On Mon, Feb 8, 2021, at 6:37 PM, Kamil Tekiela wrote: > Hi Tyson, > > 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. > > 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. The naming is fine, I think. any(), all(), first(), etc. have long-standing meaning in multiple languages. As long as we're using them consistently with convention I don't think there's any reason to introduce longer names, especially when, if done correctly, the stuff in this namespace would be highly chainable and give us a close-enough to comprehensions. Short-sweet-but-clear is a good guideline on this one. --Larry Garfield