Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!news-out.readnews.com!news-xxxfer.readnews.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Lew Newsgroups: comp.lang.java.programmer Subject: Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) Date: Thu, 17 May 2012 14:52:48 -0700 (PDT) Organization: http://groups.google.com Lines: 83 Message-ID: References: <29308868.1994.1337265697084.JavaMail.geo-discussion-forums@pbcuc6> <84131$4fb54067$5419acc3$20839@cache90.multikabel.net> <4e980$4fb56cac$5419acc3$13190@cache60.multikabel.net> NNTP-Posting-Host: 69.28.149.29 Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1337291569 12600 127.0.0.1 (17 May 2012 21:52:49 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 17 May 2012 21:52:49 +0000 (UTC) In-Reply-To: <4e980$4fb56cac$5419acc3$13190@cache60.multikabel.net> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=69.28.149.29; posting-account=CP-lKQoAAAAGtB5diOuGlDQk0jIwmH0T User-Agent: G2/1.0 Xref: csiph.com comp.lang.java.programmer:14598 Skybuck Flying wrote: > Not really, >=20 > Programmers of all languages must be able to communicate with each other= =20 > through common language and concepts. >=20 > One such concept is "range". >=20 > It's pretty clearly defined: >=20 > http://en.wikipedia.org/wiki/Range_(computer_programming) That definition does not contradict what others have said.=20 For example, it clearly states that the range of an array in=20 zero-index languages is from the lower bound (zero) to=20 one less than the length of the array. If the variables in the program you incorrectly deride=20 specified the range differently from that, you would be right,=20 but they don't, so you're wrong. > Any computer language deviating from the standard/common meaning of range= =20 > should clearly state so. Java is not such a language. > Any code deviating from the standard/coming meaning of range should clear= ly=20 > state so. The code you cite does not so deviate. > Obviously if the routine was ment to check "range" then it's flawed. Obviously it is not. If you write a loop such as=20 for (int index =3D 0; index < TOP; ++index) { ... }=20 it is perfectly legal for TOP to equal the array length, as in the=20 code you excoriate. If you wish to check that "0" and "TOP" specify=20 a valid range, you'd call that routine with=20 rangeCheck( array.length, 0, TOP); just like they say to, and it would check the range just as defined=20 in the Wikipedia article you cite. Your logic is what's flawed. I guess you aren't such a skilled "coder/debugger" as you claim. > Obviously if the routine was ment to check "range-1" then it=92s [sic] > name should have been slightly different to state just that, example: Obviously that is just your own idiosyncratic style despotism speaking. >=20 > checkRangeMinusOne >=20 > or >=20 > checkRangeInclusiveExclusive >=20 > or >=20 > CheckRangeExceptLast >=20 > Fortunately for us the code is available, but this is not always the case= in=20 > other programming languages like C where sometimes only headers are=20 > available. >=20 > Nice way to sneak in bugs ! ;) You have shown no bugs. You don't even cite how that routine is used, you only speculate and rant based on your unfounded assumptions and reasoning. --=20 Lew