Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
Originally posted by Peter Chase:
It is much more important, for most applications, to write your code clearly, concisely and robustly, than to save a few bytes of memory. Modern machines generally have plenty!
Originally posted by Jean-Sebastien Abella:
He,
I totally agree with Peter here. I never used them but isnt BitSet usefull for those situation???
-Rich, SCJP 1.4
Originally posted by Richard Anderson:
Okay, normally I would agree with you guys, but I take issue with this because you're assuming that we all build apps on PCs with enough RAM. However, when developing apps on wireless devices, you have to think about memory usage, and saving a few bytes can make all the difference.
Originally posted by Jean-Sebastien Abella:
What would you suggest then?
The use of bit mask and shift on int or long, or maybe a BitSet?
Originally posted by Richard Anderson:
Okay, normally I would agree with you guys, but I take issue with this because you're assuming that we all build apps on PCs with enough RAM. However, when developing apps on wireless devices, you have to think about memory usage, and saving a few bytes can make all the difference.
[ August 11, 2005: Message edited by: Richard Anderson ]
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
public void getTribble(int index)
{
int slot = index * 3 / 8;
int offset = index * 3 % 8;
return tribbles[ index ] >>> offset & 3;
}
Consultant to SCJP team.<br />Co-designer of SCJD exam.<br />Co-author of "Complete Java 2 Certification Study Guide".<br />Author of "Ground-Up Java".
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |