Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118928 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 48509 invoked from network); 31 Oct 2022 17:53:17 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 31 Oct 2022 17:53:17 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id AB05118004D for ; Mon, 31 Oct 2022 10:53:16 -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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS24940 176.9.0.0/16 X-Spam-Virus: No X-Envelope-From: Received: from chrono.xqk7.com (chrono.xqk7.com [176.9.45.72]) (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, 31 Oct 2022 10:53:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1667238794; bh=mx0KFrHWpnTAPpCe1973NzkV28NVr6LGQfIU2BL2cPo=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=lrffDJqtHYARzdL1UYBRZapK1IvO0etaTG8IQDcTatam4K5Uw08SgBKWjGo/sRUpQ d9qyWK1zc52hoTwiMI2Rjm3gAzXW8P/duMc7UORYXvHxN+O7xnkVUjHuVs3q8d4e7Y RWjJHrb4lhesltemJ/M2YFUOIy44H7SfzxWXp5Au/jDEd/VP6lk2Jd7BlkRpLvJTkR fMUbg88s5qZnD9D0NxGIISIp/CldtDmCWRCftFFOzGiWPJbErajW/JVlUPA4G8OD89 2AjUwIFqOSWHwNhwvXBWoeXQE4CX9QAc1hU9kW10i0fSPyGdADZPbvzqqyVoSH8JIS zRn8Qo2WNribQ== Message-ID: <381a2aa6-a479-1791-2d5b-9aac19004fd1@bastelstu.be> Date: Mon, 31 Oct 2022 18:53:12 +0100 MIME-Version: 1.0 Content-Language: en-US To: Jordan LeDoux , =?UTF-8?Q?Joshua_R=c3=bcsweg?= Cc: internals@lists.php.net References: <5ceebae4-a3fb-5d29-cdb7-dceed7b07c78@wcflabs.de> <02f9fc3b-2972-dfdb-9d76-df120efc73b3@wcflabs.de> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] Re: RFC [Discussion]: Randomizer Additions From: tim@bastelstu.be (=?UTF-8?Q?Tim_D=c3=bcsterhus?=) Hi On 10/29/22 00:44, Jordan LeDoux wrote: > I had a discussion with Tim about this naming topic as well, and want to > convey my suggestion along with the reasoning. > > I think the enum should be `Random\IntervalBoundary` with the enum cases: Yes, I agree this is a much better name for the enum itself and just adjusted the implementation and RFC. > `IntervalBoundary::Open` > `IntervalBoundary::Closed` > `IntervalBoundary::OpenRight` or `IntervalBoundary::HalfOpenRight` > `IntervalBoundary::OpenLeft` or `IntervalBoundary::HalfOpenLeft` > But for the enum members I prefer the existing naming of (Closed|Open)(Closed|Open), unless someone has a good argument for a different naming scheme: - It's very explicit, which I consider useful for two reasons which are likely related: (a) I don't have to think about what "OpenRight" means for the left boundary. (b) As not-a-native-speaker-of English I find OpenRight or HalfOpenRight not completely obvious and would likely need to look up what exactly OpenRight means, whereas ClosedOpen is understandable more intuitively. Especially since a half-open interval is sometimes referred to as half-open and sometimes as half-closed. The preferred variant might even differ across languages. - It's nicely symmetric from the naming. - It's the naming used by Prof. Goualard in the Drawing Random Floating-Point Numbers from an Interval paper (though in a shortened CC, CO, OC, OO variant). Best regards Tim Düsterhus