Skip to content

Latest commit

 

History

History
68 lines (53 loc) · 4.02 KB

STYLE.md

File metadata and controls

68 lines (53 loc) · 4.02 KB

AllenNLP Style Guide

Our highest priority for code style is that our code be easily readable to someone new to the codebase. Deep learning is easy to get wrong, and we want our code to be easy enough to read that someone looking at it can be thinking about our modeling decisions, not trying to understand what is going on.

To that end, we use descriptive names, we use type annotations, and we write coherent docstrings. In code that manipulates tensors, most lines that compute a tensor have a comment describing the tensor's shape. When there's an interesting or important modeling decision in the code, we write a comment about it (either in-line or in an appropriate docstring).

Docstrings