Page 1 of 1
A Question From The Old Days
Posted: Fri Jun 12, 2009 4:15 am
by WaltBrown
I seem to remember from way back in early Mac developing, if certain variable names were kept to 4 characters they were compiled directly, but variable names over 4 were tokenized and added an additional dereference step during execution. Does anything like that still exist in RR?
Thanks,
Walt
Posted: Fri Jun 12, 2009 8:09 am
by Mark
From
http://www-psych.stanford.edu/~pinto/hc3.html :
How long can a variable name be?
--------------------------------
According to Winkler and Kamins in _HyperTalk 2.2: The Book_,
comments and blank lines are stripped before runtime and make no
difference in speed, and short variable names also have no impact on
speed. Both of these are listed as myths on pages 49. And
longDescriptiveVariableNames do make program code so much
more readable and understandable, for yourself 6 months to a year
from when the code was written and for anyone trying to learn from
your code.
Best regards,
Mark
Posted: Fri Jun 12, 2009 8:37 am
by WaltBrown
Posted: Fri Jun 12, 2009 5:15 pm
by FourthWorld
Throughout both OS X and Windows there are a number of constants which, in languages that compile to native objects code, often compile to integers. Mac OS is historically fond of 4-byte constants for many things, such as the codes for special folder paths noted at:
http://developer.apple.com/documentatio ... 4g-C006668
For example, in C you could use the constant " kPreferencesFolderType" and with the header Folders.h it will compile to "pref".
Interestingly, you can pass those constants to Rev's specialFolderPath function to determine the paths to folders beyond the range Rev provides its own constants for, as noted at Ken Ray's site:
http://sonsothunder.com/devres/revoluti ... ile010.htm
But since Rev operates more like a virtual machine than a traditional compiler, that's about as far as it goes, and these conventions for some constants don't affect variables in any way, as Mark noted.