Post Reply 
Base converter with fractions?
02-13-2017, 02:36 PM (This post was last modified: 02-13-2017 02:37 PM by toml_12953.)
Post: #19
RE: Base converter with fractions?
(02-03-2017 02:31 PM)Han Wrote:  Just a bit of info on why I used a "random" CAS variable. I personally believe that any program should do whatever it can to preserve the state of the machine it runs on. This means leaving variables in tact where possible, restoring user settings to their original state prior to running the program, etc. Because 'tmp' could very well be a user variable (in fact, I use it a lot while doing CAS-related things), this program would over-write the user's content. On the other hand, it would be very unlikely that there is a user variable named something like tmp164503545498 (certainly too long to be user friendly, and the random digits makes a name collision highly unlikely). That was the driving factor behind using the random variable -- I can still use a CAS variable (which is necessary) without worrying too much about destroying the user's CAS variables.

To me, tmp or temp mean a temporary variable. I never care about the value of a temporary variable after the program using it ends. If I did want to preserve the value, I'd put it in a less temporary-sounding variable! (Don't ask about temperature! Big Grin ) I guess that's why I make almost all the variables in a program LOCAL so they disappear after the program ends. I do save the angle mode and other state-related variables if my program alters any of them.

Tom L

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Base converter with fractions? - Joe Horn - 01-15-2017, 05:53 AM
RE: Base converter with fractions? - Jan_D - 01-22-2017, 03:13 PM
RE: Base converter with fractions? - Jan_D - 01-26-2017, 12:38 PM
RE: Base converter with fractions? - Han - 01-27-2017, 05:00 AM
RE: Base converter with fractions? - Han - 01-26-2017, 06:57 PM
RE: Base converter with fractions? - Jan_D - 01-28-2017, 01:42 PM
RE: Base converter with fractions? - Han - 01-27-2017, 04:37 AM
RE: Base converter with fractions? - Jan_D - 02-02-2017, 05:26 PM
RE: Base converter with fractions? - Jan_D - 02-03-2017, 01:51 PM
RE: Base converter with fractions? - Jan_D - 02-21-2017, 05:59 PM
RE: Base converter with fractions? - Han - 02-21-2017, 07:30 PM
RE: Base converter with fractions? - Jan_D - 02-22-2017, 06:03 PM
RE: Base converter with fractions? - Han - 02-03-2017, 02:31 PM
RE: Base converter with fractions? - toml_12953 - 02-13-2017 02:36 PM
RE: Base converter with fractions? - Jan_D - 02-03-2017, 05:52 PM
RE: Base converter with fractions? - Jan_D - 02-13-2017, 01:14 PM
RE: Base converter with fractions? - Han - 02-13-2017, 01:27 PM



User(s) browsing this thread: 1 Guest(s)