Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!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: Sun, 20 May 2012 18:30:30 -0500 Date: Sun, 20 May 2012 16:30:27 -0700 From: Patricia Shanahan User-Agent: Mozilla/5.0 (Windows NT 5.2; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 Newsgroups: alt.comp.lang.borland-delphi,comp.lang.c,comp.lang.java.programmer Subject: Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) References: <44ccr7tidpk4jta4lhg7m954vdr7abvnte@4ax.com> <1k2dr7527p5reqegfr8oln65q55bmvo4ar@4ax.com> <67485$4fb7edfe$5419acc3$16334@cache70.multikabel.net> <4fb9714c$0$293$14726298@news.sunsite.dk> In-Reply-To: <4fb9714c$0$293$14726298@news.sunsite.dk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Message-ID: Lines: 23 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 70.230.202.8 X-Trace: sv3-IIO2Wpn/DXNnX/2qNxYZpzA2HYN8w4JlACqLFX7sXfnj0jNbZY2Zg5XniUPjKyb5XvHKiasf6b9uTog!zYbgCtI+6hGmOb0lqb3Khj0alVPwqlVFTxmf4ehMzDqh3WLSNfOgY2S4GE2ItAgaXP5sMCDuoKu5!z3VYK7bDjmT7yR7cox6Ps1h549uBCdat2DOwNd41iDYD 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: 2377 Xref: csiph.com comp.lang.c:21099 comp.lang.java.programmer:14694 On 5/20/2012 3:33 PM, Arne Vajhøj wrote: > On 5/19/2012 3:01 PM, Skybuck Flying wrote: >> However in this case, assuming it was a mistake, both programmers would >> have made the same mistake in exactly the same code, at exactly the same >> position. >> >> Now that's a bit unlikely isn't it ?! ;) >> >> Mistakes with > or >= are usually random, and not at a fixed position. > > But given that the code was correct, then your argumentation is > completely flawed. Moreover, the choice of a semi-open range was forced by the long-established public interfaces. The rangeCheck method looks like a case of taking a block of code that would be very frequently repeated in a class and making it into a private method. Doing it in such a way that every caller had to put "-1" on one of the arguments would be very strange, and create an unnecessary risk of mistakes. Patricia