Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115122 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 3619 invoked from network); 24 Jun 2021 15:49:21 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 24 Jun 2021 15:49:21 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 405DE1804C3 for ; Thu, 24 Jun 2021 09:08:09 -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,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-Virus: No X-Envelope-From: Received: from mail-qt1-f180.google.com (mail-qt1-f180.google.com [209.85.160.180]) (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 ; Thu, 24 Jun 2021 09:08:09 -0700 (PDT) Received: by mail-qt1-f180.google.com with SMTP id g12so5205136qtb.2 for ; Thu, 24 Jun 2021 09:08:08 -0700 (PDT) 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=L2NE3oykNg3vwhipcRraCJE5v1klQO+mI3qIsKfWsl8=; b=1CmUv6WX8e5qIvutoYsYjJ2M09xZcf7PizNqSgguJQh8U8WRJoRRjGWgtzzKIjFShp AvD6VvIC5N7JVhP1Dp1X9uvGds3sS2+QKnMbcMw0XQmVro0RG1GjLuHB4cmxcr2Q+WMM RhWW/SIt3yrA4dJikJLU6A8arN4UIDjJTf1iAmsaCeH1y7vzGAq1Pb7BGn7II7tSNejh VhrahtfvWxvG1GlECtJ9R0aCBOi55htM6yye35eguFb6nqQim+AXFR0jL/iX6IMRkcpp 6HvI88+l0RRUvtxXV5ADLtdKTCNmcRZTuVB2IlA6M0KrKxWJ4QkVYThthxG4Q8Aza4pa N8Tg== 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=L2NE3oykNg3vwhipcRraCJE5v1klQO+mI3qIsKfWsl8=; b=ivJdhQDFHgOJcnqKk/4zitAfjDEkssV/5u36D9A9k3UTnlgwody2EOdxR7RM+wSISm z93E8tZCIBf97T5ZTAvhcVL94+6bumLko0Hh0yCNNkYyvSnCUNTppup4lQWf98wbggsA KcZb6x9knI9sL3D4qWbz58xWzJ9VQJVBMmv4GWtPz0jlzbgaywK5IkQzD+Vrho8zZplP 6Az2Hsbnbfo1p7dmKRI5KoPyoaNtM3kah/dNquemikLJ+bqWn4MRCoqhpgSvrozVHbbe uugZiMPTpz8BlQG2WVBUDflQvOEfA2Udca+br0KR70mfTA3LLTru1K9v/7iyUFGG/IT5 j8Pg== X-Gm-Message-State: AOAM5305LhmGfbJqcMnEZAukk21AIe065u2OPh3VeAI0mp8/4e6Ti3UO VW4ZnildK1LvRQr9C8XTx27pMw== X-Google-Smtp-Source: ABdhPJz25IofTOtQc7EmPzHB2TukipcbV/JR7hiq3Zk6tgvXBzqMAFlj5KsJmZ/2+JeOwfiguZE+CQ== X-Received: by 2002:a05:622a:650:: with SMTP id a16mr5454188qtb.338.1624550886666; Thu, 24 Jun 2021 09:08:06 -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 i24sm2762465qkk.87.2021.06.24.09.08.06 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Jun 2021 09:08:06 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\)) In-Reply-To: <326d6cda-c007-f82c-469f-566e1a34e248@processus.org> Date: Thu, 24 Jun 2021 12:08:05 -0400 Cc: "internals@lists.php.net" Content-Transfer-Encoding: quoted-printable Message-ID: <6F2B8C05-45A4-4933-A88D-87A1C39FC8FE@newclarity.net> References: <0BBAA2F7-02D7-4AEE-B48A-97436A0D8E5D@gmail.com> <326d6cda-c007-f82c-469f-566e1a34e248@processus.org> To: Pierre X-Mailer: Apple Mail (2.3608.120.23.2.7) Subject: Re: [PHP-DEV] [RFC] clamp From: mike@newclarity.net (Mike Schinkel) > On Jun 24, 2021, at 7:59 AM, Pierre wrote: >=20 > Le 24/06/2021 =C3=A0 11:44, Micha=C5=82 Marcin Brzuchalski a =C3=A9crit = : >> I get an impression that we constantly add things into standard = library >> which are from a language perspective irrelevant >> and that all could be developed in userland with no harm. >>=20 >> Cheers, >> -- >> Micha=C5=82 Marcin Brzuchalski >=20 > Hello, >=20 > I respectfully do not agree with this last statement. A simple method = such as this one entirely belong to the standard library. I wouldn't = want to end-up with a NPM-like ecosystem where I'd have to choose = between clamp-php, php-clamp, php-bound-int, int-php-bound, etc... >=20 > The more the standard library will be complete, the less projects will = need dependencies, which is better for your projects long term = maintenance. You often end-up in dependency resolution hell because = library A use library B, which use foo/clamp which is not compatible = with another C library you use, or because it doesn't support PHP core = version X or Y. >=20 > A simple function such as clamp in standard library makes much sense, = anything like it must go into standard library, this way the userland = ecosystem can focus on domain related stuff, or more complex topics, = without worrying too much about this kind of detail. Having a great and = complete standard library lowers community fragmentation, and that's for = the best ! >=20 > Moreover, it also ensures that all developers speak the same language = regarding primitives provided by the standard library, and makes = communication more efficient within community. This. All of this. -Mike