It doesn't really matter from the point of view of my 2 gigahertz processor and gigabyte of RAM which way you do it. I guess you just do it the way you like.
If you were writing software for a very low spec machine, like say a pentium 3 (sic), then you would know what you were most likely to run out of, and could optimise for that. Or a handheld or cellphone or something, and even then you can probably care less, considering that my cellphone has better specs than my friend's commodore 64 back in the day. You would have to be doing something embedded I think. My argument for using Integer would be that this way you are less likely to accidently use a number that is too big, and you don't have to learn additional data type keywords. But that is not necessarily a better reason that Ross's original one. Decide how you are gonna do it from now on, and don't bother to go back and change stuff, because it is just time wasted. That's what I think. Samuel -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Neven MacEwan Sent: Wednesday, September 15 2004 8:10 a.m. To: NZ Borland Developers Group - Delphi List Subject: Re: [DUG] ShortInt, SmallInt Ross Its inefficient to use a byte in a 32 bit processor as it may have to shift it about to evaluate it. Its really academic in these days of megabyte memory to be concerned with 1 vs 4 bytes Neven MacEwan (B.E. E&E) Ph. 09 621 0001 Mob. 0274 749062 Ross Levis wrote: > I've tended to use ShortInt and SmallInt rather than Integer to not > waste memory when values are never going to exceed their maximum, but > I read somewhere that Integer should be used when possible for speed > purposes. > > I've found it slightly useful when reading the source to know that a > particular variable doesn't ever exceed 127 or 32767. > > What sort of speed differences are we talking about? Is it worth > doing a global find/replace? > > Cheers, > Ross Levis. > >----------------------------------------------------------------------- - > >_______________________________________________ >Delphi mailing list >[EMAIL PROTECTED] >http://ns3.123.co.nz/mailman/listinfo/delphi > > _______________________________________________ Delphi mailing list [EMAIL PROTECTED] http://ns3.123.co.nz/mailman/listinfo/delphi _______________________________________________ Delphi mailing list [EMAIL PROTECTED] http://ns3.123.co.nz/mailman/listinfo/delphi
