Quote:
Originally posted by kel
Your not really describing what your problem is.
I am going to let you in on a little secret, real programmers don't bother to save every teeny tiny bit here and there.
If you designing an object that might have millions of instantiation... well then I might understand if you used shorts when you don't need the capacity.
Mixing data types is generally a pain in C/Java like languages because there are strict rules that govern how the compiler will do things. You end up sending explicit casting instructions (which waste time) and don't end up with the hugest performance or space gains. And casting makes your code ugly... really ugly.
In an object with 10 members if you make one of them a short, you only save a few bytes. Even with millions of them your only saving some constant multiple of space. It might sound important but in the big scheme of things these aren't the make or break performance determinants. The exception being realtime/interactive applications.
In this case I would say just use floats throughout. If this were Java I would say doubles.
|
I'm sorry, but huh??
I can see exactly where you're coming from, but you shouldn't cloud a simple issue with big talk like instanstiation and memory management. It's unnecessary, and just adds chaos to confusion.