Skip to content

Instantly share code, notes, and snippets.

View furic's full-sized avatar
🎮
Developing game with Pixi.js and Svelte

Richard Fu furic

🎮
Developing game with Pixi.js and Svelte
View GitHub Profile
@jesseschalken
jesseschalken / code_style.md
Last active August 17, 2024 14:44
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.