Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105798 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 99665 invoked from network); 29 May 2019 19:40:03 -0000 Received: from unknown (HELO NAM05-CO1-obe.outbound.protection.outlook.com) (40.92.13.92) by pb1.pair.com with SMTP; 29 May 2019 19:40:03 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ip8q+0KKU2pu7LRtYynFKCvpOp5bOlJtqcjiN6BhfJE=; b=VzCbdqAtlYtatFo7Bvdl7Z9lH8ihuNod7bT49r53OA8N007OvtkqV7/nyY6YX4dZlY2gBAi9frBsMYLE252WmmGZH/sF+4tNCTbQtp0/iKvl0HgjpGuE9cxvsNwZglSa41S2c9YJT0dztq3vuMGYGMg7rr3/s3qTaEb2wB7bNAxquLv6/tGHFkk9cAIQuRIsMmacuS3OGClx9Dp1H7CXQ7iwWJygKXbxy8TZqFxv8yvIgpzNo4SrB0U5jWyTeqcBvGr3BsTo0y1cYVEvGDPCdyD1LESl1WpeVWkN8J2Y8jSHek+/P+4mEBig5HnI9gOkW38GtMn3x77CBDfm/Cb6Vw== Received: from BY2NAM05FT025.eop-nam05.prod.protection.outlook.com (10.152.100.55) by BY2NAM05HT194.eop-nam05.prod.protection.outlook.com (10.152.101.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1943.9; Wed, 29 May 2019 16:49:28 +0000 Received: from MWHPR06MB2861.namprd06.prod.outlook.com (10.152.100.54) by BY2NAM05FT025.mail.protection.outlook.com (10.152.100.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1943.9 via Frontend Transport; Wed, 29 May 2019 16:49:28 +0000 Received: from MWHPR06MB2861.namprd06.prod.outlook.com ([fe80::bc99:7f29:71ac:9104]) by MWHPR06MB2861.namprd06.prod.outlook.com ([fe80::bc99:7f29:71ac:9104%4]) with mapi id 15.20.1922.021; Wed, 29 May 2019 16:49:28 +0000 To: =?Windows-1252?Q?C=F4me_Chilliet?= , "internals@lists.php.net" Thread-Topic: [PHP-DEV] Re: [RFC] Numeric Literal Separator Thread-Index: AQHVCzD4Zg3fV6zubk+OJkqTtyX3naaAoYJugABd7YCAAB+7gIAAsIkAgAAN64CAAFqOgIAAHjBN Date: Wed, 29 May 2019 16:49:28 +0000 Message-ID: References: <1858501.VmE1D5L3rF@mcmic-probook> <39e8e5ad-6685-9406-68ac-1fb1edbeb537@fischer.name>,<3158562.kWcuPzWCVx@mcmic-probook> In-Reply-To: <3158562.kWcuPzWCVx@mcmic-probook> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:10F356C298827A9E6873502263AFFC09D53CC1E41B61F59DEDB5120EBDED3640;UpperCasedChecksum:97A993F3F1F0B156D377123FEA237FD1CA7C08B2B08819534743D7EAEFBEF375;SizeAsReceived:6950;Count:43 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [aJTZnzP1XaFyHEDiREr1ZIiMwdggDYfq] x-ms-publictraffictype: Email x-incomingheadercount: 43 x-eopattributedmessage: 0 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(5050001)(7020095)(20181119110)(201702061078)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031323274)(2017031324274)(2017031322404)(1601125500)(1603101475)(1701031045);SRVR:BY2NAM05HT194; x-ms-traffictypediagnostic: BY2NAM05HT194: x-microsoft-antispam-message-info: 3oE2lsvEM8lTCF2gq6oPaSy0j3rlh0c9/CARhJyWueudDGb1PoH6KLNRXZXRfW/In1+27nrhMmUo0CBHDLZk3YJT0/paHbuOcq0Czf9ydm9YvdMFHCdANOhkFyC9GxfxR/8DZOUGz7IH0J0W6DEbJl8p5iN0VhQW9etyJeabN5FYoMj+Bx6g2JLOK8HFgD2S Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: b74bcf03-5377-47b0-8dbd-08d6e4559da9 X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 May 2019 16:49:28.7151 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2NAM05HT194 Subject: Re: [PHP-DEV] Re: [RFC] Numeric Literal Separator From: theodorejb@outlook.com (Theodore Brown) On Wed, May 29, 2019 at 9:03 AM C=F4me Chilliet wrote:= =0A= =0A= > > My understanding from the RFC is that that the grouping is not=0A= > > relevant, the `_` is stripped regardless.=0A= > >=0A= > > Am I wrong?=0A= >=0A= > No you=92re not, the RFC allows grouping as the coder wants.=0A= >=0A= > Which is why I think it may cause problems because the way the=0A= > coder wants to group digits and the way easier for me to read is=0A= > not always the same.=0A= >=0A= > As Christoph M. Becker states there are already problems like this=0A= > with choice of names for variables and code style and such, but=0A= > until now numbers were a safe place that always looks the same.=0A= =0A= Numbers don't always look the same, though. They can already be=0A= written using hexadecimal, octal, decimal, binary, or exponential=0A= notation.=0A= =0A= Furthermore, as a workaround for the lack of numeric literal=0A= separators, some programmers end up writing numbers as complex=0A= expressions like `1 * 10**5 + 3 * 10**4` which can actually=0A= make them more difficult to read.=0A= =0A= > If people want to see big numbers broke up in groups of 3 I would=0A= > expect their IDE to do this on numbers for them.=0A= =0A= It isn't always desirable to group big numbers the same way, though.=0A= For example, a programmer may want to write `13500` as `135_00` or=0A= `13_500` depending on whether or not it represents a financial=0A= quantity stored as cents.=0A= =0A= > But I do get the point of the RFC for hexa and bit masks.=0A= =0A= Yes, this is another case where it can be useful to group by a=0A= varying number of digits depending on how a value is being used=0A= (e.g. nibbles, bytes, or words).=0A= =0A= So while it's conceivable that someone could use numeric literal=0A= separators to write a number in a less readable way, does this=0A= mean that the many good PHP developers shouldn't have the option=0A= to use this feature to improve readability?=0A= =0A= Sincerely,=0A= Theodore=