Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail NNTP-Posting-Date: Thu, 21 Jul 2011 17:58:46 -0500 Date: Thu, 21 Jul 2011 15:58:44 -0700 From: Patricia Shanahan User-Agent: Mozilla/5.0 (Windows NT 5.2; WOW64; rv:5.0) Gecko/20110624 Thunderbird/5.0 MIME-Version: 1.0 Newsgroups: comp.lang.java.programmer Subject: Re: Arithmetic overflow checking References: <015aeb15-57db-48ab-9cd4-77f8448b632f@w24g2000yqw.googlegroups.com> <2rydnez7l-H5BYnTnZ2dnUVZ_vGdnZ2d@earthlink.com> <4e278a67$0$309$14726298@news.sunsite.dk> <1SSVp.69032$_I7.18660@newsfe08.iad> <4e2892f1$0$309$14726298@news.sunsite.dk> In-Reply-To: <4e2892f1$0$309$14726298@news.sunsite.dk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Message-ID: Lines: 30 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 70.230.200.239 X-Trace: sv3-9ehnFVEAdjJXw3ckdNRrqwx6mRxQy2XWrsR4PW1jxsD/od/SMtmhlhjWJLzpTwqgKCmvgy3Nnsmc2Rc!kquGj2SbHxuYvs6zpWU6jg2/N8r3HmNIRtxyXljFZHb0QgymYC1TbuPTbLPq+6y2VRD8GS9dq7x5!BnRFgWF/wTAK7Cozb91In0oi9A2bWFunTLVyrnpSN38rQrQ= X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2810 Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:6376 On 7/21/2011 1:58 PM, Arne Vajhøj wrote: > On 7/21/2011 8:32 AM, Andreas Leitgeb wrote: >> supercalifragilisticexpialadiamaticonormalizeringelimatisticantations >> wrote: >>> On 21/07/2011 6:05 AM, Arved Sandstrom wrote: >>>> ... Why don't you write a proper class for your data type? >>> In four words: Lack of operator overloading. >>> Math on non-primitive types is *painful* in Java. >> >> agreeCount = agreeCount.plus(AgreeCount.ONE) >> on painfulness of non-primitive math. > > It does not look good. > > But I find it hard to believe to be a significant problem in typical > business apps. I agree. After all, it is no worse than "ADD 1 TO AGREECOUNT GIVING AGREECOUNT.". I do have a serious concern with lack of either operator overloading or complex primitives as one of the barriers to use of Java for engineering and scientific programming. The problem is not just the keystrokes for typing the expressions. It is very important to be able to check that a lengthy expression in a program is a correct translation of the corresponding expression, in mathematical notation, in a textbook or paper. Patricia