Article View: comp.lang.objective-c
Article #172Re: NO NUMBERS! (or even SHORT INTS!)
From: Robert Andersen
Date: Mon, 28 Sep 1992 16:21
Date: Mon, 28 Sep 1992 16:21
31 lines
1895 bytes
1895 bytes
In article <1992Sep28.003421.1246@RedBrick.COM> jfr@RedBrick.COM () writes: > I can see the need for memory > conservation to some degree, but certainly there is no performance > benefit on most machines today (there may even be a performance penalty > in obscure cases). I can also see the need to store short ints on disk > for databases since memory can multiply radically when you have large > databases. But for in-memory structures, particularly counters and indexes > and thinks like that, there is simply no justification to use short ints. Why would you use a long when a short would suffice. If your reading a file in 80 byte increments would you declare a 5000 byte string to hold the data. > Why would you EVER use NUMBERS in a program. Maybe you had to support multiple versions of functions in one program, don't flame me in this it is just a thought; a function that complies to some standard name ieeeblah(). Basically your problem is that the coder used a short int without realizing that it only has two bytes and could only store -32768 to 32767. It wasn't a problem with the types. That's like saying I used a byte and I didn't realize that it could only hold 256 values. Besides you could have made it unsigned and increased the size. -- Robert John Andersen (919) 380-6523 (v,w) andersen%reality@glv.com - NeXT mail! Outside of a dog, a book is man's best friend. Inside of a dog it's too dark to read.
Technical Details
Message-ID:
<1992Sep28.162135.8904@glv.uucp>Path:
arc1-ca.pugleaf.net!sparky!uunet!decwrl!concert!glv!usenetReferences:
<1992Sep28.003421.1246@RedBrick.COM>Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.objective-c Path: arc1-ca.pugleaf.net!sparky!uunet!decwrl!concert!glv!usenet From: andersen@reality (Robert Andersen) Subject: Re: NO NUMBERS! (or even SHORT INTS!) Message-ID: <1992Sep28.162135.8904@glv.uucp> Sender: usenet@glv.uucp Nntp-Posting-Host: reality Organization: Encompass References: <1992Sep28.003421.1246@RedBrick.COM> Date: Mon, 28 Sep 1992 16:21:35 GMT Lines: 31