Replies: 5 comments 1 reply
-
your ergonomic advantage is true, and anyway the guidelines https://github.com/openframeworks/openFrameworks/wiki/oF-code-style already states that a single space shall be uses! (no attempts at aligning) on that front has there been an attempt at a .clangformat? (and also maybe study the OF guidelines compatibility vs what Xcode does with ctri-i (muscle memory there)) |
Beta Was this translation helpful? Give feedback.
-
related PR #7353 |
Beta Was this translation helpful? Give feedback.
-
i tried running the style script and the results surprised me.... it seems it has not be ran in a while (notably some options don't work anymore). it also reveals a lot of core OF does not adhere to the style guide (most poignantly, the style guide prescribes indentation for the
|
Beta Was this translation helpful? Give feedback.
-
i agree that it's better not to indent but that's one thing amongst many: how to structure such a revision process? there is code history, personal prefs, etc... as mentioned above i don't mind much and happy to let others figure it out, but i need a config+tool that can apply the style. (note that we're discussing here whitespace, tabs, indent, brace position usage -- things like class and variable names are out of scope). then adjust the tool (for this i can be of use). there are currently in OF scripts based on uncrustify so maybe some good work there, and maybe it's just a matter of adjusting the config (once the style is agreed upon). or from scratch, clang-format is less "powerful" than uncrustify but seems simpler to configure and run, so an easy way out it to adopt one of the base clang-format styles (actual comparisons here) and refine from there. a quick look indicates the webkit style is the closest to the current OF style. whichever tool is chosen, 3 or so "test cases" files should be elected from the source and serve as tests to validate the tool config. but how shall this style revision be executed so the concrete work can then be performed? |
Beta Was this translation helpful? Give feedback.
-
closed by #7655! |
Beta Was this translation helpful? Give feedback.
-
I think we should change this style of tabulating function names and variable names out of the types. I can think of one ergonomic advantage of using only one space:
sometimes you will search in all OF code to see where is that function and you know the name and the type. You look for let's say: "void setWindowTitle" but it doesn't return anything because instead of one space you have one or more tabs.
Thoughts? @artificiel @ofTheo @2bbb @Jonathhhan
Beta Was this translation helpful? Give feedback.
All reactions