[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
RE: st: -stylerules- updated on SSC
This is a simple but most valuable distinction.
-stylerules- is about programming style. Most
programs have some generality, and most stylish
programs have much generality. Comments should
be for explaining what would otherwise be obscure, usually
more or less clever tricks.
But do files are fully of nitty-gritty specifics
and as Ronán implies only very rarely are they
over-commented. Often the Stata syntax is easy to understand,
but not the scientific or practical reasoning.
> Nick Cox wrote:
> > Depends on what anyone means by "many"...
> > I find that novices often over-comment, as in
> > // now find the sum
> > su `myvar' if `touse', meanonly
> > local sum = r(sum)
> I think that there is a useful distinction to be made between
> a program and commenting a do file. Most novices
> under-comment do-files
> that prepare data for analysis and conduct the analysis.
> I was reading over some do-files I wrote 10 years ago and
> horrified at
> the tweaks and changes I made to the data which presumably
> fixed errors
> identified by the researcher at the time, but whose rationale
> is nowhere
> documented. But I am less a Stata novice than I was then.
> At least, until Mata hits my desktop.
* For searches and help try: