openframeworks / openframeworks/openFrameworks
Indentation of public, protected, private keywords
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 10.4k
- Forks
- 2.6k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 9
Description
I am suggesting a little change to the coding style used for oF.
I would like to remove the indentation of public, protected and private keywords.
Here is the snippet from the style guidelines I am referring to:
The public, protected, and private keywords should be indented inside the class with the function declarations indented as well.
Every time a new line is added in a header file, it gets indented according to the IDE's (in my case Xcode) default style. And one has to manually indent the line.

I guess most people using Xcode as their IDE (I haven't checked the latest survey) and the default Xcode style is the default for other IDEs too, as Arturo says in (https://github.com/openframeworks/projectGenerator/issues/59). I can confirm Qt Creator uses the same styling.
In my opinion this often leads to bad formatted code.
Another point I would like to change is the order of the following two lines in the ofApp template. They should be swapped to be in the same order as in the implementation file.
void dragEvent(ofDragInfo dragInfo);
void gotMessage(ofMessage msg);
What were the reasons for the indentation? And what are the disadvantages of changing the style guidelines?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the cited style-guideline excerpt and locating the ofApp template and its corresponding implementation declarations. Confirm the project's preferred access-label indentation and declaration order before changing the guidelines or templates; done means the decision is documented and the affected examples consistently follow it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- developer-experience, documentation
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100