LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #15   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default Proper Programming

"Tushar Mehta" wrote...
No reason why you shouldn't. I use Integer and Bytes to indicate
intent. In fact, I wish I could declare a variable as
X as Real {-49..+49} or
X as Whole Number {-100..-50}
and have the compiler / OS / firmware / hardware enforce integrity.


There are languages which provide this. It could be implemented in C++,
creating Real and Whole classes with definable lower and upper value bounds
and the ability to throw exceptions when values exceed these bounds. Granted
it's a lot of work, but the capability exists.

Now, whether 'simple' languages like BASIC should provide this is arguable.

The time for worrying about nanosecond performance improvements
resulting from hardware-aligned variables has long since past. The
only time I worried about that kind of stuff was when programming in
Assember on a IBM360 -- and even then just for a lark.


You the application programmer may not gain much from concerning yourself
with memory alignment issues, but the systems programmers who write language
compilers and interpretters must because it's IMPOSSIBLE (as in the
hardware/CPU can't do it) to do some things unless you start out at a 16- or
32-bit boundaries.

In this age of hardware floating point processing, the only thing provided
by smaller integer or floating point types is potentially more economical
use of system storage. Actual calculations are generaly unaffected whether
operands are 8, 16 or 32 bits long. For individual (scalar) variables, the
benefits from saving 1 or 3 bytes is more than offset by the *cumulative*
performance penalty of dealing with non-paragraph alignment. There are
stronger arguments in favor of actually conserving memory when it comes to
arrays of potentially more economical types.




 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
=PROPER() Mukesh Excel Discussion (Misc queries) 2 June 6th 09 06:45 AM
Proper !!! Excel Discussion (Misc queries) 8 February 22nd 08 02:17 AM
Not Proper! Adam Excel Worksheet Functions 2 September 19th 07 12:08 PM
proper afdmello Excel Discussion (Misc queries) 3 October 11th 05 09:48 AM
=proper Scrappy[_2_] Excel Programming 3 November 13th 03 09:43 PM


All times are GMT +1. The time now is 10:28 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"