-
Notifications
You must be signed in to change notification settings - Fork 0
openFrameworks Coding style guidelines
This is a preliminary page for formulating coding style guidelines for openFrameworks, to give a homogeneous look to our source files, and make reading/understanding/developing code for oF easier. It will be improved in the coming weeks, and its final form will define the code style all oF contributors should abide by.
The main entry point for the discussion is this thread on the forums: http://forum.openframeworks.cc/index.php/topic,6891.0.html, please discuss there.
oF-code-style contains the oF code style details. I't based on the Qt code style, but has been modified for openFrameworks' needs.
This will be fleshed out in more detail, but there are several automatic tools available in the mainly used IDEs which can make it easier for developers to keep their code in compliance. However, keep in mind that automatic tools only go so far, and cannot check all the requirements.
A detailed policy on how and when code compliance checks should happen will be outlined here.
Feedback regarding the performance/suitability of these tools is welcome!
AStyle is an automatic tool for code formatting. It supports a wide variety of style ootb, and I (bb) think it's quite easy to assemble a config file for AStyle usage.
It seems XCode is worst off, only thing I could find is rudimentary AStyle support: http://eatmyrandom.blogspot.com/2011/03/xcode-astyle-part-2-for-xcode-4x.html
There's an AStyle http://wiki.codeblocks.org/index.php?title=Source_Code_Formatter_plugin for code::blocks.
Eclipse has an automatic source formatter which can be configured in detail. A K&R template is included ootb, and bilderbuchi will produce an importable settings file detailing the chosen oF code style.
?
There are a few sources which served as a basis for how the oF code style looks like:
The K&R Java style, but this seems to cover mostly indentation, so it's not really complete.
The Qt Coding Style is a comprehensive document detailing the coding style for Qt. Barring objections, this will be the base template which will be modified to suit the needs of the oF community.
A Pirate Pad document made during ofdev-con in early 2011.