Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Martin Gregorie Newsgroups: comp.lang.java.programmer Subject: Re: Autoboxing and Performance ? Date: Fri, 23 Aug 2013 23:37:46 +0000 (UTC) Organization: A noiseless patient Spider Lines: 30 Message-ID: References: <5csRt.197906$jW3.50636@fx23.iad> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Fri, 23 Aug 2013 23:37:46 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="e5160e2be48f1ea550cf61512446f525"; logging-data="1432"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/wKvCW/7gFe039fMtR6XPx1s3hzSALPKI=" User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2) Cancel-Lock: sha1:slCOwC7LItf+cGyUY34jUJ1WeGY= Xref: csiph.com comp.lang.java.programmer:25130 On Fri, 23 Aug 2013 01:58:02 +0000, Stefan Ram wrote: > When every physical value has a dimension at runtime, this indeed even > helps to avoid errors, for example, to avoid adding a lenght and an > angle. > That's a different issue. Quite simply, any equation that adds a length to an angle is INVALID and any paper that included such an equation should fail peer review and be rejected. There is a method for detecting that type of error that's taught in first year university physics and chemistry classes: its called "dimensional analysis". Example of a bogus equation, which will be meaningful for all you long-time SF fans out there: the Blackett-Dirac equation at the heart of James Blish's "Cities in Flight" novels fails dimensional analysis, so a spindizzy can never work. Unfortunately. Coming back on topic, computer programs are far more likely to be calculating with measured quantities and so will need to know the units used to take each measurement than they are to be doing dimensional analysis. Hence, any object that represents a measurement should, for strict OO conformance, contain both the numeric value and the units with which the measuring instrument is calibrated as well as a method to convert measurements in any appropriate unit to another. -- martin@ | Martin Gregorie gregorie. | Essex, UK org |