[Tutor] Which is better in principle: to store (in file) calculated data or to re-calculate it upon restarting program?
boB Stepp
robertvstepp at gmail.com
Tue Jul 30 12:21:57 EDT 2019
I have been using various iterations of a solitaire scorekeeper
program to explore different programming thoughts. In my latest
musings I am wondering about -- in general -- whether it is best to
store calculated data values in a file and reload these values, or
whether to recalculate such data upon each new run of a program. In
terms of my solitaire scorekeeper program is it better to store "Hand
Number, Date, Time, Score, Total Score" or instead, "Hand Number,
Date, Time, Score"? Of course I don't really need to store hand
number since it is easily determined by its row/record number in its
csv file.
In this trivial example I cannot imagine there is any realistic
difference between the two approaches, but I am trying to generalize
my thoughts for potentially much more expensive calculations, very
large data sets, and what is the likelihood of storage errors
occurring in files. Any thoughts on this?
TIA!
--
boB
More information about the Tutor
mailing list