Skip to content

Instantly share code, notes, and snippets.

View Vaansh's full-sized avatar
🌊
learning & exploring

Vaansh Lakhwara Vaansh

🌊
learning & exploring
View GitHub Profile
@jesseschalken
jesseschalken / code_style.md
Last active November 14, 2024 15:46
Code style

My preferred code style is 2-space K&R. This is intended to provide a justification for this style.

Why K&R?

K&R style has the following properties:

  1. Provides symmetric size (in terms of screen space consumed) between the opening and closing syntax of a clode block.
  2. Forces no empty or meaningless lines, thereby avoiding artificial distance between related things that should be together.
  3. Consumes the minimum vertical space while keeping the opening and closing syntax of a block on separate lines from the content.