Skip to content

Instantly share code, notes, and snippets.

View mcoderz's full-sized avatar

Mauro Abner mcoderz

View GitHub Profile
@jesseschalken
jesseschalken / code_style.md
Last active February 6, 2026 05:45
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.