Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial clang-format file #39
Initial clang-format file #39
Changes from all commits
07d3f59
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😘
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kinda like middle :-D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know I will not convince anybody. But a tab is actually the semantically correct thing to indent. People often confuse this with aligning certain stuff and then complain if it looks different when someone sets a different tab width. Use spaces for alignment and tabs for indenting. This way people can set their tab width to whatever they prefer and the code just displays differently, but has the same semantic indentations.
However, this takes discipline and maybe that effort is spent better elsewhere. New versions of clang-format have
AlignWithSpaces
which does that, but I never tried it. So sticking with spaces is fine for me.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tabs are not available if you write code snippets in online forms where the form e.g. on GitHub
+1 for not allowing tabs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @bernhardmgruber about tabs. I do not like alignment (not invariant under refactoring). Without alignment there is not reason not to indent with tabs.
I kinda see @psychocoderHPC 's point, but unless the coding style indents with a single space, you will not write correctly formatted code in a browser form anyway. I doubt that limitations on snippets should dictate style in the actual code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tabs only make sense if you disallow spaces for intent at the same time. Otherwise things get wildly mixed.
Every editor can set tabs to spaces, do the simple thing, use spaces.