80 character limit

Pros:

  • Forces you to focus on legibility.

    • Emphasis on short.

  • Encourages preserving source control blame

  • Long lines raises concerns on naming

Cons:

  • Some languages may not be suitable for 80 characters.

  • Can make some functions or conditions longer

    • When writing conditions, consider breaking them into multiple conditions. See below for reasoning.

  • The focus on short may may become bad.

    • Example: Bad variable names.

    • Example: Too many small functions. Makes it difficult to understand flow.

    • Aim for balance.

Considerations:

  • Not everyone has the same screen size as you

  • Choose the lowest common denominator

    • How many characters can comfortably in the tools you use?

      • GitHub split diff views

        • 13" MacBookPro on "More Space" Resolution (1680x1050) can only comfortably show 104 characters

        • 1280px width can comfortably show 87 characters.

      • See my testing

Exceptions:

  • URLs. Always try to use full URLs as much as possible as it helps the reader to intuit the purpose of the URL.

Notes:

Last updated