Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce how to write comments in .do files #101

Open
korenmiklos opened this issue Jan 26, 2022 · 2 comments
Open

Introduce how to write comments in .do files #101

korenmiklos opened this issue Jan 26, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@korenmiklos
Copy link
Contributor

No description provided.

@korenmiklos korenmiklos added the enhancement New feature or request label Jan 26, 2022
@yuanyuan0314
Copy link

Hi~I hope I didn't misunderstand this prompt. For writing comments, I commonly use three different marks: /**/, //, *.
I think there are also some tricks to make the do-files readable. There are four things I usually do:

  1. At the beginning of the do-file, I list the updated date, the goal, and the structure of this do-file.
  2. I use a whole line of * to separate each "chapter" of the do-file.
  3. I use // to write the purpose of some lines if it is not straightforward.
  4. I use /**/ to save the results of some important lines below the lines themselves. For example, I will store the results of _merge for future reference without rerunning the codes.

Those tricks are very personalized. It might be too redundant. But it should be helpful for archiving finished projects. It might take a while to review a small part of the codes without comments.

Thank you!

@korenmiklos
Copy link
Contributor Author

Thank you, @yuanyuan0314 . Do you want to add this to https://github.com/datacarpentry/stata-economics/blob/main/_episodes/05-programming.md and submit a pull request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants