[18518] in cryptography@c2.net mail archive
Re: Java: Helping the world build bigger idiots
daemon@ATHENA.MIT.EDU (Jeremiah Rogers)
Tue Sep 20 17:24:00 2005
X-Original-To: cryptography@metzdowd.com
X-Original-To: cryptography@metzdowd.com
Date: Mon, 19 Sep 2005 12:17:44 -0400
From: Jeremiah Rogers <jeremiah@kingprimate.com>
Reply-To: Jeremiah Rogers <jeremiah@kingprimate.com>
To: Peter Gutmann <pgut001@cs.auckland.ac.nz>
Cc: cryptography@metzdowd.com
In-Reply-To: <E1EHJxx-0006SI-00@medusa01.cs.auckland.ac.nz>
It used to be that checking bounds on certain collections was less
efficient than waiting for the out of bounds exception. I think Joshua
Bloch discusses this in his book.
I've also seen this in generated code where you aren't sure of the
nature of the object you're indexing and thus don't know the
appropriate length variable (.length vs .length()).
That said it's still awful.
On 9/19/05, Peter Gutmann <pgut001@cs.auckland.ac.nz> wrote:
> Found on the Daily WTF, http://www.thedailywtf.com/forums/43223/ShowPost.=
aspx:
>
> try {
> int idx =3D 0;
>
> while (true) {
> displayProductInfo(prodnums[idx]);
> idx++;
> }
> }
> catch (IndexOutOfBoundException ex) {
> // nil
> }
>
> The editor also comments that when he got the first few of these submitte=
d he
> rejected them as being faked, but ended up with so many that he realised =
this
> usage must be relatively common.
>
> Peter.
>
> ---------------------------------------------------------------------
> The Cryptography Mailing List
> Unsubscribe by sending "unsubscribe cryptography" to majordomo@metzdowd.c=
om
>
--
Jeremiah Rogers
---------------------------------------------------------------------
The Cryptography Mailing List
Unsubscribe by sending "unsubscribe cryptography" to majordomo@metzdowd.com