Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:106774 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 91501 invoked from network); 28 Aug 2019 23:11:35 -0000 Received: from unknown (HELO mail-pl1-f169.google.com) (209.85.214.169) by pb1.pair.com with SMTP; 28 Aug 2019 23:11:35 -0000 Received: by mail-pl1-f169.google.com with SMTP id h3so497948pls.7 for ; Wed, 28 Aug 2019 13:43:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:openpgp:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=3q5rZaGPtXVhwZhshQB1wbiFnGc0TOal2x1bMeU+a60=; b=NkkYjxc8SAaYBFWctttHRH83r6DFvuXNxe2vhWTzjZa+UTZBtK4IsHCIdHQit3Fkjn MRT6rbzU1BMepkrvvYIuasmFwmIkC6A3GFEnyEaxKvdBfD74UxwJfnCFHcp5veCLqqgV IVZoFN2pTcP+BAxxAhfZ+CHvwMhf1RXBPbZJ7yrEnZH4F9NKxCNmBDgg8K/3mCwskQji nmhH7Rpz10sZMoBS7gA61r7qBtpMOacALWEk/Nz3a05zzg4tIZM65o/jQCN+5sVli+mJ P40FSmBkzl7fkKV45NBAeEMRdYOgFbHwgxU9Y5a2To3B2waoVk4D9h4jW8mr3pz/9bT5 F5tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=3q5rZaGPtXVhwZhshQB1wbiFnGc0TOal2x1bMeU+a60=; b=WnWn+FYWgE0c78SpOPARQShtUWKm5tHfbWbCalfw0LFG4cNDV/l0Kus0YoiVY9t5Ac Marw1O5YuQaGd7z4KWMdM+B2jN7+YajgzDOwb/X+g4FsHoDJHwOEVSJil5iOXJSF9PFE 8i/MrLv4nil+ThU/FwEowVCUFKsgWV5SDTuKUSpCQ7KcV/ccR6/2DxCC+yVMhA8umErn 5hSWqEGDWuqGiVC8YLIBuRjftfeieGCes4D1QmuJJV4C9E5fBuuxDQSZDUZY0lnq9ty4 0IMLgMqSRKiRouOHrGQ7iCXd+ozoYutmIA8TPwxtjfSFGBy3yBJkvrb4W3oKW7T9SYxY /u/A== X-Gm-Message-State: APjAAAXu3eKO/qL9gI1hMoDpmWck3NmFRptYKqyBNzD7W6FrxMH0SA+F +twHxpP6VhrXzD6uiZiqwPSW0P8Dmg== X-Google-Smtp-Source: APXvYqxOlACtoFoIE9H0gAOlqzT1h9TA5bD8Tz1F4wnlY1rMxok3Q45T8JEWY1HEM2TVH9NrU7MqPg== X-Received: by 2002:a17:902:d917:: with SMTP id c23mr6285132plz.248.1567025028101; Wed, 28 Aug 2019 13:43:48 -0700 (PDT) Received: from Stas-Pro-2070.lan (c-76-126-84-88.hsd1.ca.comcast.net. [76.126.84.88]) by smtp.gmail.com with ESMTPSA id a1sm274309pfl.53.2019.08.28.13.43.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Aug 2019 13:43:47 -0700 (PDT) To: Mark Randall , internals@lists.php.net References: <5d668ea6.1c69fb81.6921b.bb41SMTPIN_ADDED_MISSING@mx.google.com> <5d66e3d9.1c69fb81.1d4c5.2d73SMTPIN_ADDED_MISSING@mx.google.com> Openpgp: preference=signencrypt Autocrypt: addr=smalyshev@gmail.com; prefer-encrypt=mutual; keydata= mQMuBE9mqaARCACFSqcGmNunkjQQu3X+yXnTmFeEkvM4JXZTOBdR8aEevNGmmFEfyvjaDjWi 9hcwp4E/lYtC+P7VsVjM1OSX9eq0jC/lGL0ZyRXek+mNy0n5H1NSuTpf9Y18LMqhc4G+RU+L cNiZ9K0DJuOOvNLPxW7OHZguxb3wdKPXNVa2jyRfJAKm2uaJJMT1mTmFT9a0Q8SKr+mUrrJk uG0H2o6SzrKt8Wwoint1e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TFCij+uQINBE9mqaAQCADfZPMpjZkkGZj3BY/7ApoLq4mwqzbh +CpLXwNn20tFNvSXfb8RdeXvVEb7Scx+W9qYpiaun2iXJgCVH8fgpZpR856ulT1q6uCG++CX ubEvip/eJkZl93/84h04KQJwsgOrAh0Om3OePRn8Pr+++0LNS0EL8uX/YHeTOGOnnmTqYTey SBVFdov6L4mepddfjekicKQqhL7mZh/xuq29JijT0uNNX8v4vDWQDu5dlAcdd+uB3gcXMD/P ginD11zp+6wtrWCm/+yBqpvDwXQX5PGUnwvbRfl7Ay3MmwmoXiecZMg0dwTSc7e0lhB4HGRH ZdBMJB4rHUVGdzqujK/ctOvrAAMFB/0Utb76Qe6sCMlHxVAmeE/fbo7Pi05btZ/x01r67dHf aMSP0riCKJ7M0OW+jAXtu9+z/BVnYisW67WWfxl2cS5tZDgiHgJARXWUOO72+sScHP8KQmTl 1z16gyKbwY3SmyBkwcpOL35nhUWNLy93syPoY6sZUTikr2bZYukHDQ33XBPs4e6MbWKfsa9q aVmnlOF3k5UqChjutfHaEa4Q7VP4wBIpphHBi9MI16oJIzzBPbGl2uoedjwiZ6QeQZnSuOVY ZxU2d3lRA8PrtfFN1VSlpEm/VcAvtieHUYWHN0wOu+cp3Slr5XJVNjTjJhl28SlinMME54mK AGf2Ldr/dRwXiGEEGBEIAAkFAk9mqaACGwwACgkQL3lWvF2gS126EQD/VVd3FgjLKglClRQP zdfU847tqDK4zJjbmRv5vLLwoE0A+wbrQs7jVGU3NrS0AIl5vUmewpp2BKzSkepy23nWmejw Message-ID: <365b6086-6a6e-7ac9-be4d-dcf99581a5d6@gmail.com> Date: Wed, 28 Aug 2019 13:43:46 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <5d66e3d9.1c69fb81.1d4c5.2d73SMTPIN_ADDED_MISSING@mx.google.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Reclassifying engine warnings From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > Because it's explicit, and incrementing null is mathematically > unintuitive. After all, null does not exist anywhere in the set of It is well-established in programming that default value for numeric types is 0 (many Java IDEs, for example, will explicitly tell you if you initialize a numeric value to 0 that it's not necessary). It is also well established that natural conversion of null to numeric is 0. I don't see anything non-intuitive here. Even if you have no idea about programming at all, how do you start counting? You had nothing, than one, then two, etc. You don't count like "did I start counting? No? Then nothing. Did I start again? Oh, now I did, then it's one. Did I start again? Oh yes, I did already, so it's two.". Nobody counts like that. It's completely non-intuitive and that's why I called it a clunker. It's working around language trying to be "helpful" but ending up forcing extra work because it looked "cleaner" to somebody. > ?? Let's you go "I know this index may not exist, if it doesn't, use 0 > instead". No funky type coercions that are in no way apparent from > looking at the code. Everybody - I mean literally everybody, I have not seen any exceptions I can think of over my 30+-year career in software - wants to start from 0 if counting wasn't started yet. If they didn't, there would be explicit initialization beforehand, you don't just suddenly forget you want to start counting from 100, it's an unusual thing that you remember. Starting from 0 you don't have to remember because everything starts from 0. There's no case for it being anything else. There's no need to make it explicit - nobody would imagine you mean anything but that, because nobody ever does anything but that ever. Spelling it out is just wasting time for the sake of being "strict". No added value. > To use the analogy someone posted elsewhere... the training wheels are > coming off. Time to be responsible and type those few extra characters > to be clear on your intent. Removing training wheels doesn't mean putting a boot on instead. No need to make something harder just for the sake of forcing people to explicitly acknowledge the situation that is obvious for everybody anyway. There can be only one intended way this construct could work, and it should work this way without spelling it out explicitly. -- Stas Malyshev smalyshev@gmail.com