[Home] [By Thread] [By Date] [Recent Entries]

  • From: John Cowan <cowan@l...>
  • To: XML Dev <xml-dev@i...>
  • Date: Wed, 21 Jul 1999 10:09:56 -0400

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)
version.

> 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@c...
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@i...
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@i... the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@i... the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@i...)



Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member