A query about approved programming practice. In official Stata, most
programs go out of their way to protect users from their own stupidity
whenever there is a possibility that a user might accidentally over-write
an existing data set in the memory. In particular, if a data set is present
in the memory, then -use- will only input a new data set if the user
specifies the -clear- option, and -exit- will not exit from Stata unless
either the user specifies -clear- or the data set is unchanged. A notable
exception is the -collapse- command, which routinely destroys pre-existing
data sets, presumably because any user who uses -collapse- is assumed
thereby to have consented implicitly to have the existing data set
destroyed. People in the Stata community who write their own packages
usually want their programs to conform to the same high level of
user-friendliness as official Stata. Is there a general set of rules,
approved by StataCorp or otherwise, regarding when programs should or
should not routinely overwrite existing data sets in memory without a
-clear- option? I ask because I have previously written ado-files (notably
-parmest- and -dsconcat-) which can overwrite existing data sets in memory,
and I have been advised (by Bill Gould) that they should do more than they
do to protect users from their own stupidity (as -use- does and -collapse-
doesn't).
Best wishes (and thanks in advance)
Roger
--
Roger Newson
Lecturer in Medical Statistics
Department of Public Health Sciences
King's College London
5th Floor, Capital House
42 Weston Street
London SE1 3QD
United Kingdom
Tel: 020 7848 6648 International +44 20 7848 6648
Fax: 020 7848 6620 International +44 20 7848 6620
or 020 7848 6605 International +44 20 7848 6605
Email: [email protected]
Opinions expressed are those of the author, not the institution.