Skip to content

Coding Style Guide

Kai-Zhan Lee edited this page Jan 31, 2017 · 3 revisions

Style

  • Use 1-space padding for each binary operator (e.g. x +. y, let x = 3, x ** 32)
  • Don't put spaces around unary operators (e.g. x--, x[0], *x)
  • Place comments before every major block of code, every "step" of the process
  • Use tabs, please!

OCaml

  • Comments should be padded with spaces like so: (* your comment here *)

C

  • Multiline and one-line comments should be padded with spaces like so: /* your comment */ and // comment
  • First curly brace on the same line as keyword
  • Space before a curly brace and after a keyword for (int i = 0; i < 10; i++) {...

Clone this wiki locally