Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #14594
| From | "Skybuck Flying" <Windows7IsOK@DreamPC2006.com> |
|---|---|
| Newsgroups | alt.comp.lang.borland-delphi, comp.lang.c, comp.lang.java.programmer |
| References | (1 earlier) <29308868.1994.1337265697084.JavaMail.geo-discussion-forums@pbcuc6> <e69c4$4fb51b41$5419acc3$11300@cache100.multikabel.net> <slrnjra97k.d62.fis@iris.zem.fi> <84131$4fb54067$5419acc3$20839@cache90.multikabel.net> <jp3g9r$v22$1@speranza.aioe.org> |
| Subject | Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) |
| Date | 2012-05-17 23:25 +0200 |
| Message-ID | <4e980$4fb56cac$5419acc3$13190@cache60.multikabel.net> (permalink) |
| Organization | Ziggo |
Cross-posted to 3 groups.
" "glen herrmannsfeldt" wrote in message news:jp3g9r$v22$1@speranza.aioe.org... In comp.lang.java.programmer Skybuck Flying <Windows7IsOK@dreampc2006.com> wrote: (snip) >>> if (fromIndex < 0) >>> throw new ArrayIndexOutOfBoundsException(fromIndex); >>> if (toIndex > arrayLen) >>> throw new ArrayIndexOutOfBoundsException(toIndex); (snip, someone else wrote) >> I believe it is checking whether the range fromIndex, fromIndex+1, ..., >> toIndex-1 -- i.e., a range given as the first index and one past the >> last index, not an uncommon practice -- is within the array, in which >> case it has no bugs. (toIndex may legally equal the length of the array >> when the range extends to the last element, and requiring the range to >> be specified "the right way around" is not especially perverse.) >> " > It's simply not valid. Out of bounds has a very clear meaning > in programming practice. It's either within bounds or it's not. But this isn't "programming" it is Java, and Java can do it however it wants to. > The bounds of a java array are very clearly defined. Thus the > only logical conclusion is that the code is simply bugged. > Either in logic or in description. Either change the > exception-description or fix the code. Look at the definition of the substring method in String class. It avoids a lot of -1 by the programmer to define it this way. (Along with consistently starting indexing at zero.) " Not really, Programmers of all languages must be able to communicate with each other through common language and concepts. One such concept is "range". It's pretty clearly defined: http://en.wikipedia.org/wiki/Range_(computer_programming) Any computer language deviating from the standard/common meaning of range should clearly state so. Any code deviating from the standard/coming meaning of range should clearly state so. Obviously if the routine was ment to check "range" then it's flawed. Obviously if the routine was ment to check "range-1" then it’s name should have been slightly different to state just that, example: checkRangeMinusOne or checkRangeInclusiveExclusive or CheckRangeExceptLast Fortunately for us the code is available, but this is not always the case in other programming languages like C where sometimes only headers are available. Nice way to sneak in bugs ! ;) Bye, Skybuck.
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) "Skybuck Flying" <Windows7IsOK@DreamPC2006.com> - 2012-05-17 15:09 +0200
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) Joshua Cranmer <Pidgeot18@verizon.invalid> - 2012-05-17 09:23 -0400
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) "Skybuck Flying" <Windows7IsOK@DreamPC2006.com> - 2012-05-17 17:26 +0200
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) Heikki Kallasjoki <fis+usenet@zem.fi> - 2012-05-17 16:19 +0000
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) "Skybuck Flying" <Windows7IsOK@DreamPC2006.com> - 2012-05-17 19:57 +0200
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2012-05-17 18:33 +0000
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) "Skybuck Flying" <Windows7IsOK@DreamPC2006.com> - 2012-05-17 23:25 +0200
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) Lew <lewbloch@gmail.com> - 2012-05-17 14:52 -0700
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-05-17 14:58 -0700
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) Joshua Cranmer <Pidgeot18@verizon.invalid> - 2012-05-17 17:59 -0400
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) Heikki Kallasjoki <fis+usenet@zem.fi> - 2012-05-17 22:13 +0000
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) "Skybuck Flying" <Windows7IsOK@DreamPC2006.com> - 2012-05-18 01:18 +0200
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) Joshua Cranmer <Pidgeot18@verizon.invalid> - 2012-05-17 21:32 -0400
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) Noob <root@127.0.0.1> - 2012-05-18 17:08 +0200
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) "Skybuck Flying" <Windows7IsOK@DreamPC2006.com> - 2012-05-19 20:53 +0200
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) "Skybuck Flying" <Windows7IsOK@DreamPC2006.com> - 2012-05-19 21:19 +0200
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-05-19 18:47 -0700
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) "Skybuck Flying" <Windows7IsOK@DreamPC2006.com> - 2012-05-20 17:55 +0200
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) "Skybuck Flying" <Windows7IsOK@DreamPC2006.com> - 2012-05-19 20:18 +0200
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) "Skybuck Flying" <Windows7IsOK@DreamPC2006.com> - 2012-05-19 20:21 +0200
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) "Skybuck Flying" <Windows7IsOK@DreamPC2006.com> - 2012-05-19 20:52 +0200
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) Arne Vajhøj <arne@vajhoej.dk> - 2012-05-20 18:27 -0400
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) Lew <noone@lewscanon.com> - 2012-05-19 14:48 -0700
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) Lew <noone@lewscanon.com> - 2012-05-19 15:20 -0700
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) Lew <noone@lewscanon.com> - 2012-05-19 15:35 -0700
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) Arne Vajhøj <arne@vajhoej.dk> - 2012-05-20 18:25 -0400
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) bugbear <bugbear@trim_papermule.co.uk_trim> - 2012-05-21 17:12 +0100
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) Heikki Kallasjoki <fis+usenet@zem.fi> - 2012-05-18 07:22 +0000
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) Lew <noone@lewscanon.com> - 2012-05-19 14:50 -0700
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) Arne Vajhøj <arne@vajhoej.dk> - 2012-05-20 18:21 -0400
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) Arne Vajhøj <arne@vajhoej.dk> - 2012-05-20 18:23 -0400
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) "Skybuck Flying" <Windows7IsOK@DreamPC2006.com> - 2012-05-18 01:09 +0200
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) Arne Vajhøj <arne@vajhoej.dk> - 2012-05-20 18:14 -0400
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) "Skybuck Flying" <Windows7IsOK@DreamPC2006.com> - 2012-05-21 09:36 +0200
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) "Skybuck Flying" <Windows7IsOK@DreamPC2006.com> - 2012-05-20 17:53 +0200
Re: names for parameters of ranges Arne Vajhøj <arne@vajhoej.dk> - 2012-05-20 18:30 -0400
Re: names for parameters of ranges Gene Wirchenko <genew@ocis.net> - 2012-05-20 20:48 -0700
Re: names for parameters of ranges (was: ...) Willem <willem@toad.stack.nl> - 2012-05-23 09:43 +0000
Re: names for parameters of ranges Willem <willem@toad.stack.nl> - 2012-05-23 11:07 +0000
Re: names for parameters of ranges Willem <willem@toad.stack.nl> - 2012-05-23 15:42 +0000
Re: names for parameters of ranges Willem <willem@toad.stack.nl> - 2012-05-23 11:11 +0000
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) Heikki Kallasjoki <fis+usenet@zem.fi> - 2012-05-17 19:13 +0000
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) Heikki Kallasjoki <fis+usenet@zem.fi> - 2012-05-17 19:19 +0000
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) Jim Janney <jjanney@shell.xmission.com> - 2012-05-17 18:35 -0600
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) "Skybuck Flying" <Windows7IsOK@DreamPC2006.com> - 2012-05-17 23:16 +0200
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) Arne Vajhøj <arne@vajhoej.dk> - 2012-05-20 18:32 -0400
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) "Skybuck Flying" <Windows7IsOK@DreamPC2006.com> - 2012-05-21 09:40 +0200
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) Joshua Cranmer <Pidgeot18@verizon.invalid> - 2012-05-21 10:05 -0400
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) Arne Vajhøj <arne@vajhoej.dk> - 2012-05-20 14:41 -0400
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) Arne Vajhøj <arne@vajhoej.dk> - 2012-05-20 18:12 -0400
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) Keith Thompson <kst-u@mib.org> - 2012-05-20 16:38 -0700
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) Lew <noone@lewscanon.com> - 2012-05-20 18:52 -0700
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) Keith Thompson <kst-u@mib.org> - 2012-05-20 19:21 -0700
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) gazelle@shell.xmission.com (Kenny McCormack) - 2012-05-21 08:24 +0000
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) "Bill Leary" <Bill_Leary@msn.com> - 2012-05-23 14:34 -0400
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2012-05-20 21:46 -0600
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) Lew <noone@lewscanon.com> - 2012-05-21 00:04 -0700
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) gazelle@shell.xmission.com (Kenny McCormack) - 2012-05-21 08:25 +0000
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) "Skybuck Flying" <Windows7IsOK@DreamPC2006.com> - 2012-05-21 09:46 +0200
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) jacob navia <jacob@spamsink.net> - 2012-05-17 18:54 +0200
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) Mark Storkamp <mstorkamp@yahoo.com> - 2012-05-17 12:06 -0500
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) markspace <-@.> - 2012-05-17 10:11 -0700
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) Lew <lewbloch@gmail.com> - 2012-05-17 14:43 -0700
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) markspace <-@.> - 2012-05-17 16:13 -0700
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) markspace <-@.> - 2012-05-17 16:42 -0700
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) Jan Burse <janburse@fastmail.fm> - 2012-05-18 02:27 +0200
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) Arne Vajhøj <arne@vajhoej.dk> - 2012-05-20 15:06 -0400
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) "Marius" <sorry@nospamfor.me> - 2012-05-17 17:32 +0000
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) "Skybuck Flying" <Windows7IsOK@DreamPC2006.com> - 2012-05-17 23:45 +0200
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) "Marius" <sorry@nospamfor.me> - 2012-05-17 22:16 +0000
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) "Skybuck Flying" <Windows7IsOK@DreamPC2006.com> - 2012-05-18 00:47 +0200
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) "Skybuck Flying" <Windows7IsOK@DreamPC2006.com> - 2012-05-24 14:11 +0200
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) "Skybuck Flying" <Windows7IsOK@DreamPC2006.com> - 2012-05-24 14:17 +0200
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) Roedy Green <see_website@mindprod.com.invalid> - 2012-05-18 02:57 -0700
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) Leif Roar Moldskred <leifm@dimnakorr.com> - 2012-05-18 05:26 -0500
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) Joshua Cranmer <Pidgeot18@verizon.invalid> - 2012-05-18 08:08 -0400
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) Arne Vajhøj <arne@vajhoej.dk> - 2012-05-20 14:46 -0400
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) rossum <rossum48@coldmail.com> - 2012-05-18 12:25 +0100
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) Gene Wirchenko <genew@ocis.net> - 2012-05-18 10:46 -0700
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) "Skybuck Flying" <Windows7IsOK@DreamPC2006.com> - 2012-05-19 21:01 +0200
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) Arne Vajhøj <arne@vajhoej.dk> - 2012-05-20 18:33 -0400
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) Patricia Shanahan <pats@acm.org> - 2012-05-20 16:30 -0700
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) Gene Wirchenko <genew@ocis.net> - 2012-05-20 20:36 -0700
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) Kaz Kylheku <kaz@kylheku.com> - 2012-05-21 04:28 +0000
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) "Skybuck Flying" <Windows7IsOK@DreamPC2006.com> - 2012-05-21 09:55 +0200
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) "Skybuck Flying" <Windows7IsOK@DreamPC2006.com> - 2012-05-21 09:49 +0200
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) Joshua Cranmer <Pidgeot18@verizon.invalid> - 2012-05-21 10:08 -0400
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) "Skybuck Flying" <Windows7IsOK@DreamPC2006.com> - 2012-05-21 10:45 +0200
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) "Skybuck Flying" <Windows7IsOK@DreamPC2006.com> - 2012-05-21 11:13 +0200
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) "Skybuck Flying" <Windows7IsOK@DreamPC2006.com> - 2012-05-21 11:19 +0200
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) Lew <lewbloch@gmail.com> - 2012-05-21 11:40 -0700
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) Arne Vajhøj <arne@vajhoej.dk> - 2012-05-20 18:10 -0400
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) "Skybuck Flying" <Windows7IsOK@DreamPC2006.com> - 2012-05-21 10:00 +0200
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) Joshua Cranmer <Pidgeot18@verizon.invalid> - 2012-05-21 10:10 -0400
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) falk@rahul.net (Edward A. Falk) - 2012-05-23 05:40 +0000
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) Jim Janney <jjanney@shell.xmission.com> - 2012-05-23 08:46 -0600
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) "Skybuck Flying" <Windows7IsOK@DreamPC2006.com> - 2012-05-24 14:03 +0200
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) Lew <lewbloch@gmail.com> - 2012-05-24 09:56 -0700
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) falk@rahul.net (Edward A. Falk) - 2012-05-26 00:52 +0000
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) Jamie <jamie_ka1lpa_not_valid_after_ka1lpa_@charter.net> - 2012-05-25 21:16 -0400
Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) Kevin McMurtrie <mcmurtrie@pixelmemory.us> - 2012-05-24 09:42 -0700
csiph-web