Principles - norrissam/ra-manual GitHub Wiki
This wiki is my guide to coding and project management. It is a collection of principles and procedures that I have found minimize the risk of mistakes, and make it as easy as possible to collaborate with many coauthors.
I have three core principles in project management, which motivate almost everything in the rest of this guide. These principles are:
- One-stroke production. The entire project, from initial data to all final results, tables, and figures, can be run from one command, typically code/master.do. This means that all intermediate steps (e.g. importing and analyzing data, taking output tables and inserting into an exhibits document, compiling the exhibits document) are fully automated. This prevents us from, for example, changing a data prep routine but forgetting to update all the results.
- Consistency and clarity. Use the same syntax and standardized procedures throughout, to make it easier for your coauthors and your future self to understand your code. Delete code that isn't being used anymore (Github will remember it if we really need it).
- Decisions in as few places as possible (don't duplicate code). Decisions should be concentrated wherever possible, to minimize the number of code updates that would need to happen to implement a change. For example, if we make the same sample restriction each time we load the data for analysis, this restriction should happen in a helper file. Then, if we want to change the sample, we can change one helper file rather than many different places where the data is loaded. The same principle applies to other code, and I encourage liberal use of helper and .ado files.