Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail Content-Type: text/plain; charset="UTF-8" Message-ID: <1639100.PjNAD8PV0k@PointedEars.de> From: Thomas 'PointedEars' Lahn Reply-To: Thomas 'PointedEars' Lahn Organization: PointedEars Software (PES) Date: Sat, 25 May 2013 07:00:33 +0200 User-Agent: KNode/4.10.2 Content-Transfer-Encoding: 8Bit X-Face: %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&. <4493946.nSsM8AgQI3@PointedEars.de> MIME-Version: 1.0 Lines: 37 NNTP-Posting-Date: 25 May 2013 07:00:38 CEST NNTP-Posting-Host: 3e04067d.newsspool3.arcor-online.net X-Trace: DXC=4I@\E3 On Fri, 24 May 2013 12:17:28 -0700, Daniel Pitts wrote: >> Yes, but if (x === true) can not be reduced to if (x). > > How about if(x===!0) I think that was the point of the comment. However, it is not a good idea. This is not just an equivalent expression. Since we must not assume optimization, it includes an *additional operation* *each* time this statement is executed. For what? Two octets less loaded the *one* time it is loaded – a time savings of 0.3 ms in the *worst* case (56k dial-up modem)? > if "!0" is identical to "true" then the test "x===true" is identical to > the test "x===!0" And +!1 is equivalent to 0. We still write only 0; not because it is shorter, but because it is *less complex*, i.e. *faster*. > Where I use "is identical to" in the sense of "===", whereas I would use > "is equivalent to" in the sense of "==" Making up your private terminology is not helpful. An *expression* is /equivalent/ to another *expression* if both expressions are evaluated to the same value under the same conditions; one expression can be exchanged with the other without affecting the outcome of expressions in which they are used. A *value* is /identical/ to another *value* if both values are the same. -- PointedEars Twitter: @PointedEars2 Please do not Cc: me. / Bitte keine Kopien per E-Mail.