Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Documenting ssc contributions: efficiency for Man and machine


From   [email protected]
To   [email protected]
Subject   Re: st: Documenting ssc contributions: efficiency for Man and machine
Date   Mon, 19 Jan 2004 10:50:56 -0600

I would like to add a little to what Bill Gould
<[email protected]> said concerning comments in ado code.

> Allan is so concerned about ths potential problem he is even thinking about 
> submitting two versions to SSC, one with, and one without comments!
> 
> That will not be necessary.  When Stata reads ado-files from disk into memory,
> Stata does not store the comments.  Allan is right that comments would cause
> an intepretive language to slow down.  Stata strips the comments for Allan.
> 
> The only cost to comments is the time it takes Stata to read them from disk
> and discard them, which is not much.  If, however, Allan feels obligated to
> write an essay (which I sometimes do), I suggest he go to the bottom of the
> file, add an -exit-, and then write away.  That will keep Stata from even
> having to read the lines.

You might also want to look at -help comment- in Stata.  You can
save a tiny bit of time when Stata loads an ado file by using the
more modern // and /// comment delimiters instead of /* */.  When
Stata sees "/*" it has to keep looking at everything until it
finds the matching "*/".  With // and /// it can ignore
everything else on that particular line and move directly to the
next line.

The time savings is probably so minor as to be unimportant, but
since the subject came up, I am pointing it out.


Ken Higbee    [email protected]
StataCorp     1-800-STATAPC

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index