Skip to content

Latest commit

 

History

History
53 lines (37 loc) · 1.61 KB

style_guide.md

File metadata and controls

53 lines (37 loc) · 1.61 KB

Style Guide

Basics

Linters and automated code formatters can save you tons of time and they make it easy for collaborative projects to have consistent code formatting.

Use default settings in all cases (except setting Pylint to work with Black).

All are easily (or natively) integrated into VS Code. The R packages are also easily integrated into R Studio.

Additional Rules

There are some things that the automated tools can't handle themselves. A few additional things to be consistent about are listed below. They all follow the most commonly used style guides for each language (though they are sometimes more specific, e.g., for R variable names).

Python and R

These adhere to PEP8 and the tidyverse style guide.

Identifiers

  • ClassName
  • variable_name
  • function_name
  • CONSTANT_VALUE

Javascript

These adhere to the Airbnb style guide.

  • Use const or let as appropriate. Don't use var.
  • Use dot notation for accessing properties, not bracket notation, when possible.
  • Use === and !== instead of == and !=.
  • Start all comments with a space after the //.

Identifiers

  • ClassName
  • objectName
  • functionName