Skip to content
bilderbuchi edited this page Sep 27, 2011 · 40 revisions

The openFrameworks code style, modelled on the Qt style as of 27.9.2011

Indentation

  • 4 spaces are used for indentation
  • Spaces, not tabs!

Declaring variables

  • Declare each variable on a separate line

  • Avoid short (e.g. “a”, “rbarr”, “nughdeget”) names whenever possible

  • Single character variable names are only okay for counters and temporaries, where the purpose of the variable is obvious

  • Wait when declaring a variable until it is needed // Wrong int a, b; char *c, *d;

    // Correct int height; int width; char *nameOfThis; char *nameOfThat;

All modifications to the Qt style

Clone this wiki locally