Re: Re: RFC [Discussion]: Randomizer Additions
| From: | Tim Düsterhus | Date: | Mon, 31 Oct 2022 17:53:12 +0000 |
| Subject: | Re: Re: RFC [Discussion]: Randomizer Additions | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-118928@lists.php.net to get a copy of this message | ||
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.
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üsterhusIntervalBoundary::OpenIntervalBoundary::ClosedIntervalBoundary::OpenRightorIntervalBoundary::HalfOpenRightIntervalBoundary::OpenLeftorIntervalBoundary::HalfOpenLeft