Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: RE: mulitple comments using // and #d;


From   SamL <saml@demog.berkeley.edu>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: RE: mulitple comments using // and #d;
Date   Fri, 1 Sep 2006 14:07:25 -0700 (PDT)

Please don't do follow Mike's advice.  Elegant though it may be to retire
-delimit-, several factors necessitate maintaining the command.  I'll
mention only two.

First, the ability to use old code would seem to require maintaining
delimit.  Other posts convincingly conveyed that version control is *not*
a time machine.  The only other alternative would be to go through and
remove all those self-proclaimed delimiters.  I can think of far better
uses of time for those who use stata.

Second, those who write code on a unix box with few bells and whistles
(e.g., color) are seriously advantaged by being able to specify their own
delimiter.  And, I believe the -delimit- command is deeply consistent with
stata philosophy for, like most parts of stata, it cedes power to the
user.

One need not use delimit if one does not want to do so.  But retiring the
command?  That seems unwarranted.

Respectfully yours.
Sam

On Fri, 1 Sep 2006, Michael S. Hanson wrote:

>
> 	I don't necessarily have a better story, but some additional
> observations and suggestions.
>
> 	First, I agree with Nick that using -delimit- is not the best way to
> program in Stata (any more).  At best, I would suggest, it is a relic
> of times gone by, and should be depreciated in favor of ///.  But
> that also may give one a clue towards what might be a "better" story.
>
> 	Consistent with some other program languages (which I mercifully
> have long stopped using), Stata also allows a comment to be denoted
> by an asterisk -- *if* it is the first character on a line.  Thus, while
>
> #delimit ;
> // comment
> // comment;
> pwd;
>
> will not work,
>
> #delimit ;
> * comment
> * comment;
> pwd;
>
> *does* work, provided the trailing semicolon in the final comment is
> included.  I suspect that * comments are parsed differently than //
> comments -- which, incidentally, can appear anywhere in a line -- and
> that is why the second example works.  While I completely lack any
> supporting evidence, I suspect this too, is a relic of times gone by.
>
> 	Alternatively, if you *start* a // comment line with a semicolon, as
>
> #delimit ;
> ;// comment
> ;// comment
> pwd;
>
> the code works as well, but IMHO that is *really* ugly.  Again, I
> suspect your best bet is to scrap the use of -delimit- and adopt //
> for comments and /// for line continuations.  With a decent text
> editor, you can have these character strings highlighted as a unique
> part of the syntax, which makes editing your code that much easier.
> (I also think it would be helpful if Stata's build-in editor provided
> some degree of basic syntax highlighting, as in this example, but I
> recognize that is a controversial view around here... to say the least.)
>
>                                          -- Mike
>
>
> *
> *   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/
>
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index