Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105799 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 33889 invoked from network); 29 May 2019 21:24:41 -0000 Received: from unknown (HELO mail-pg1-f180.google.com) (209.85.215.180) by pb1.pair.com with SMTP; 29 May 2019 21:24:41 -0000 Received: by mail-pg1-f180.google.com with SMTP id w34so377347pga.12 for ; Wed, 29 May 2019 11:34:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=basereality-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=InnGzKvMzJQRYNYKwy2+NwhajqyGqsfh4E1Np8uXnN8=; b=cYIgV+Z15f3XnUgkVqEjPnTJvTJYjopqY6yXbdwmTMDf8y9IG4+kvviPUp93iBAoGs Z2fYmiBcb/p4QQazI9ZISiJjIKzdApBOTXCu2St9hzl7NoD0pcGLp0MObgZ1voGVY+J7 +g2sc4lFDUF58Iy1s/l/MgnMBbIZDLSO65BFXsb49nSbjgHznEZ7uNUU+mf2IVnij19e 8nGOZeihfjlBvG4FNeKEg+yoc/RbSWPIMPvhoRcDCnHIVgfBNTFksDafszGzWKt1xZhw Y1j9sJUfKhojYcGlxLJWYwPDH+EhdHdlYLCmK5NeITxNv922Z1xHsgHJLYTTI9Bd7OfG onlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=InnGzKvMzJQRYNYKwy2+NwhajqyGqsfh4E1Np8uXnN8=; b=Cg+RSGjAVxbLq0Y5P858u/X3Z+iZFm/tGWEJ66ewnC5SX6Duq0wwi3LhwRioeDzzqE u8XgbELzpdhdAYaymque/GpRI2HE3ulGaCqUt9P7Z+/dS5NdaOjpr7X02fX5poNm6djG YowNrYlNdv4F3t3KjS9MY9oBipzwlPPOqvp5X13OKPcsPu2ydhldLWdrloh7WfynmRiD AgvwLz8extjymNuvXwCYTilR+7eZ5ueS1cJaoO4KF1Qk6SDYCRFF179AqbCNxd9ufdwF JIPa1N7G4P/cLGeGEyJR8k8uxdw7espSPfQOZMhb/ZatPcJtJS6a2etWUqS1sQxpdohQ 8ZKw== X-Gm-Message-State: APjAAAXIRRqg2jw0FZ+jTu8pjBtHcsNZ/tJOs1p5eiBNb48FUDHJ5MGT wRG8FiW9bkTo6e6yGRVo0EOFhEvO/b9Ad8Oc0IE7Zg== X-Google-Smtp-Source: APXvYqwHFptOxwXour5xsLt3lVjemSheY6JdcluvYw1frVLeGlNE1vnyn1rwCL+qWgyyF0bKzXWVGcz4b7pBkj8SiGs= X-Received: by 2002:a17:90a:9dc1:: with SMTP id x1mr14267946pjv.102.1559154848016; Wed, 29 May 2019 11:34:08 -0700 (PDT) MIME-Version: 1.0 References: <1858501.VmE1D5L3rF@mcmic-probook> <39e8e5ad-6685-9406-68ac-1fb1edbeb537@fischer.name> In-Reply-To: Date: Wed, 29 May 2019 19:33:57 +0100 Message-ID: To: "G. P. B." Cc: PHP internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] Re: [RFC] Numeric Literal Separator From: Danack@basereality.com (Dan Ackroyd) On Wed, 29 May 2019 at 12:35, G. P. B. wrote: > > Also I think those kind of magic numbers should be constants with > meaningful names, and it that case you could just compute them by adding > powers of ten. > E.g. DISCOUNT_IN_CENTS = 1 * 10^5 + 3 * 10^4 + 5 * 10^3; I agree naming things is important, but when I'm working with non-programmers (e.g. the people in the accounts department), and we have lots of numbers in front of us, something like: EXAMPLE_ON_BUDGET = 1_000_000; EXAMPLE_UNDER_BUDGET = 990_000; EXAMPLE_OVER_TARGET = 1_001_000; EXAMPLE_WAY_OVER_BUDGET = 1_100_000; is going to be way easier to read than either the version without underscore, and definitely easier than power of ten notation. cheers Dan Ack