Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsreader4.netcologne.de!news.netcologne.de!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail Content-Type: text/plain; charset="UTF-8" Message-ID: <2749906.Zugg1RVdLx@PointedEars.de> From: Thomas 'PointedEars' Lahn Reply-To: Thomas 'PointedEars' Lahn Organization: PointedEars Software (PES) Date: Fri, 24 May 2013 21:56:22 +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: 46 NNTP-Posting-Date: 24 May 2013 21:56:23 CEST NNTP-Posting-Host: dbfd8a23.newsspool3.arcor-online.net X-Trace: DXC=AX=@bFI6eZfj5k5aEF7ISmMcF=Q^Z^V3h4Fo<]lROoRa8kF On 5/23/13 8:53 AM, Thomas 'PointedEars' Lahn wrote: >> Andrew Poulos wrote: >>> [true minized to !0] >> >> They should reconsider their approach as they are exchanging a minor >> increase in loading performance against a probably larger reduction of >> runtime performance, adding an operation (“!”) where there does not have >> to be one, just for the sake of two octets less per occurrence (“!0” vs. >> “true”). >> >> They should ask themselves instead why there were so many occurrences of >> ”true” in the code in the first place. If I wrote a minimizer, *that* is >> where I would look first. For example, >> >> if (x == true) >> >> and >> >> if (true == x) >> >> can be minimized to the equivalent, shorter, more efficient >> >> if (x) > > Yes, but if (x === true) can not be reduced to if (x). Which is precisely why nobody suggested that. > Also, perhaps you're returning true after doing something that succeeded: > > if (flibber()) { flub(); return true; } > if (flabber()) { noFlub(); return false; } > > In these cases, reducing true and false to !0 and !!0 might make sense. It does not, for the reasons I have already given. In particular your latter suggestion is utter nonsense, adding *yet* *another* operation where does not have to be one (false === !1). -- PointedEars Twitter: @PointedEars2 Please do not Cc: me. / Bitte keine Kopien per E-Mail.