Unix/Java design issues (Was: Re: Is CDATA "structure"?)

John Cowan cowan at locke.ccil.org
Wed Jul 21 16:07:35 BST 1999

Marcelo Cantos wrote:
> > The basic problem is code like this:
> >
> >       unsigned count;
> >       while (--count > 0) {
> >               /* do something */
> >               }
> >
> > This loop will never fail,
> Yes it will.  I presume you were thinking of >=.

Yes.  It's hard to write bad code *deliberately*; I hesitated for
a while, and finally settled for the above (incorrectly correct)

> Usually one will find that if 2 billion isn't a large enough number
> then 4 billion isn't either (or won't be for long), and a 64 kB file
> size limit is hardly less annoying than a 32 kB limit, so increased
> numerical range isn't as compelling an argument for unsigned types as
> it might seem.

Just so.

> Consequently I think it is unwise to enforce a no-unsigned-types rule.

In the Java context, however, I think it is safe enough.

	John Cowan	http://www.ccil.org/~cowan	cowan at ccil.org
Schlingt dreifach einen Kreis um dies! / Schliesst euer Aug vor heiliger Schau,
Denn er genoss vom Honig-Tau / Und trank die Milch vom Paradies.
			-- Coleridge / Politzer

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)

More information about the Xml-dev mailing list