Statalist


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

Re: st: Some questions about editors and directory management


From   Jeph Herrin <junk@spandrel.net>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Some questions about editors and directory management
Date   Wed, 09 Jul 2008 15:28:24 -0400

Malcolm,

1) The editor issue doesn't frustrate me as much as some, because
   unlike many contributors here I only rarely feel inclined to
   submit a portion of a do-file. I use VIM with the Stata syntax
   add-on, but if you like modern editors you probably won't like
   this. I write my do files to be short and specific; in the case
   I do need to run a fragment, I just paste it to a do-file editor
   window.

   I'll add that a 4-button mouse (ie, with a button for Copy and
   a button for Paste) will save a great deal of time in any GUI
   environment.

2) For various reasons I keep my projects highly segregated in the
   (windows) file system, as you do. I won't try to impose (or even
   explain) the logic behind my setup, but will point out several
   tools that you may find helpful, in addition to the ones you
   mention.

   a) -include- lets you put all of your macro assignments (for
   full pathnames) into a single file and then -include- it at
   the top of every dofile. This makes maintenance easier.

   b) Even better is the package -fastcd- from stbplus, which lets you
   build a database of paths with assigned mnemonics. The advantage
   to this over macros is that it is seamless for both programming
   and interactive use.

hth,
Jeph




Malcolm Wardlaw wrote:
I have a couple of process questions that I wanted to ask the statalist. No rush at all, but I'd like to hear people's opinion, especially if they feel they have a solid solution.
-------------
1) Do File Editors:
It's always perplexed me that Stata has no IDE. Theres that basic text editor for writing do files, but it's incredibly basic and has none of the important features that are standard in coding environments, most notably markup. I currently use WinEdt as my do file editor. It's OK, but it's kind of quirky. It's great for LaTeX, but I feel like at least my current configuration is kind of shoddy.

So, does anyone have what they feel is a really good coding environment, or perhaps a really intuitive and reliable WinEdt setup?
-------------
2) Directory Management
Is there a standard protocol for managing data directories? I often keep multiple different "original" datasets in directories on my computer (a windows box, by the way.) I also try to keep my programs and log files in separate directories based on the project. I then have my do files immediately send the working directory to "c:\data" and query or write logs and final output back to those directories by path.

This causes two problems which are not serious, but kind of annoying, especially if I am executing only part of a do file. The first is that the paths are sometimes unwieldy and I lose track of my output and logs when I execute a master do file. The second is that I like to keep my programs relatively flexible like SAS, so that I can port them to our mega-server without too much search and replace path changing.

To get around this second issue, I assign the directory path to a local macro string at the top of the file and then always refer to the path by that local macro. It's a little messy and annoying when executing part of the file, since the macro is assigned at the top. I know I could assign the macros globally and keep them around. But these are all hacks I came up with myself, and they don't feel very formal.

Is there a standard way to handle this sort of thing or a personal setup that anyone finds useful? And by procedure, I mean not just fixing my macro issues, but structuring the entire data environment and import/export procedures to make this run in a robust and orderly way.
-------------
Any advice on this issue would be much appreciated.

Malcolm Wardlaw
*
* 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