Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: Critique on comment syntax and suggestions


From   "David Radwin" <dradwin@mprinc.com>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Critique on comment syntax and suggestions
Date   Fri, 28 Jan 2011 09:38:09 -0800 (PST)

Bryce,

I was tripped up by the interaction of semicolon delimiters and comments
recently, too, as were others in the past, before the built-in editor had
syntax highlighting:

http://www.stata.com/statalist/archive/2008-11/msg01338.html
http://www.stata.com/statalist/archive/2008-09/msg01271.html

But there is another solution: don't use semicolon delimiters, even if you
are accustomed to using them in other software.

Nick Cox makes this point in "Suggestions on Stata programming style"
(Stata Journal 2005, vol 5, Number 4, pp. 560-566).
http://www.stata-journal.com/sjpdf.html?articlenum=pr0018

David
--
David Radwin
Research Associate
MPR Associates, Inc.
2150 Shattuck Ave., Suite 800
Berkeley, CA 94704
Phone: 510-849-4942
Fax: 510-849-0794

www.mprinc.com


> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-
> statalist@hsphsun2.harvard.edu] On Behalf Of Mason, Bryce
> Sent: Friday, January 28, 2011 9:21 AM
> To: statalist@hsphsun2.harvard.edu
> Subject: st: Critique on comment syntax and suggestions
> 
> Listers,
> 
> Although not a question, thought this might be of interest as a
"gotcha."
> 
> I was stymied by poor commenting practice but also by STATA's inflexible
> color coding of comments. Consider the following:
> 
> # delimit ;
> * This next line won't get processed because I forgot to put a semicolon
> drop if criticalvar=1;
> 
> Unfortunately, STATA's do-file editor inappropriately colors the line
with
> the drop command as if it will be processed, even though the delimiter
was
> not applied to the comment line. It would be great if the do-file editor
> knew that we were using a semicolon and made that whole section green
> until it encountered a semicolon, but I do not see this being easily
> implemented.
> 
> We will be moving our standard commenting practice to /* and */ in order
> to avoid this issue.
> 
> Hope it Helps,
> 
> Bryce
> 
> 
> Bryce Mason, Ph.D.
> Director of Institutional Research
> Loyola Marymount University
> 1 LMU Drive, Suite 4820
> Los Angeles, CA 90045-2659
> e: bryce.mason@lmu.edu<mailto:bryce.mason@lmu.edu>
> w: (310) 258-8838
> f: (310) 338-1841
> 
> 
> 
> 
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index