Statalist


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

st: RE: getting started with TextMate


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: getting started with TextMate
Date   Fri, 11 Dec 2009 17:21:54 -0000

I am not clear how syntax highlighting would help with that. 

1. On command names, most highlighting schemes don't understand Stata at
a deep level at all. They just are based on a list of names that the
editor is instructed to highlight. So, at some level you are dependent
utterly on what somebody typed into a file defining the highlighting. If
that included abbreviations, the editor will highlight a command name in
a certain way; and if not, not. Also, no such scheme based on a list of
names can include your own command names unless you added them! 

2. On variable names, I don't know how you expect any editor to
distinguish between full and abbreviated variable names. In principle,
that could be done if and only if you have data in memory in Stata and
the editor can look at that data in Stata and see what is what in
relation to a .do or .ado that it is editing (setting aside a yet
further complication that the .do or .ado might be able another dataset
or about none in particular). I haven't checked to see if Stata does
this, although I much doubt it, but it's an enormously tough call for an
external editor! That is, suppose I am a text editor and I see "foo" in
a .do file: how am I to know whether this is a full variable name, an
abbreviated variable name or a typo w.r.t. one or more datasets? 

I think highlighting makes editing a little more colourful in every
sense and good schemes show up some errors, chiefly unmatched items such
as quote marks, parentheses, brackets and braces. But what is called
highlighting varies markedly. Some schemes advertised as such just
highlight command names as in 1 above. I don't think that could impart
much understanding of Stata or save many errors. Equally, it does little
or no harm. Perhaps there is a placebo effect with highlighting. 

The bottom line remains that to understand Stata you have to use it and
read the documentation! 

Nick 
n.j.cox@durham.ac.uk 

Michael McCulloch

I've recently learned of TextMate and its ability of color syntax  
highlighting. That has appeal to someone like me just learning Stata,  
because at my experience level it's better for me to not write overly  
contracted command or variable names.


*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index