On Sat, Dec 08, 2007 at 02:06:03PM -0500, Brian Hurt wrote:
> I have personally come to the opinion that the main use of having more 
> than one type of integer is to allow the programmer to pick the wrong one. 

Cute, but wrong.  It's like saying - having more than one size of
screw/screwdriver/hammer/engine/boat is wrong.

> Using only a single word, or a partial-word, to represent an integer is an 
> *optimization*, not a data type consideration.  Having the programmer pick 
> what word size to hold the integer in is a fraught with potiential bugs 
> and portability problems as having the programmer pick what register to 
> hold the integer in.

Sure.  It's the same problem as building a car with a small engine.
It might be 'efficient', or 'inadequate', depending on a variety of
conditions.

> This isn't just about the Y2038 bug- although that's an example.  It's 
> about the whole C99 long long fiasco.  It's about the 32-bit limit that 
> Java's starting to hit hard- Java used int's to index arrays, so you can't 
> have an array with more than 2^31 elements.  Etc.

If you have an array with more than 2^31 elements, your Java program will
run like a snail - your design is most likely wrong, or you picked the
wrong language to solve your problem.  Hrm... somebody once said that
the reason there are many of X is so you can pick th wrong one.

I wonder if it still applies 8^)

florin

-- 
Bruce Schneier expects the Spanish Inquisition.
      http://geekz.co.uk/schneierfacts/fact/163
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.mn-linux.org/pipermail/tclug-list/attachments/20071208/bac00f71/attachment.pgp