Styleguide - cogcommscience-lab/lab-docs GitHub Wiki
Core Principles
You will write code in this lab, and the code will stay in the lab long after you leave. Others might use your code, and they need to be able to understand it. Our goal is to make as much of our code public as possible. So write code for stranges under the assumption that your code is being shared.
With that in mind, please keep these guidelines in mind when writing code in the lab:
-
If this is code for a lab project, please add the project repo to the lab https://github.com/cogcommscience-lab/ (email Richard for doing this).
-
Point one above makes it clear that you should use Git version control for your code and keep your code in a GitHub repo. Please do this for all projects, even small ones. For very small, one-off projects, please use Gist. All projects should have a README.md file that explains the code.
-
To the extent possible, write your code in a Jupyter Notebook
-
Do NOT use CaMeL CaPs or blank spaces when naming files. To the extent possible file names should be lower-case and use underscore instead of a blank space.
good_filename.txt
VeryBad no GoodFileName.txt
Styleguides
Part of the way to write easy to understand code is to make sure that it conforms to a given styleguide. Here are the styleguides for several of the languages we use in the lab: