Skip to content

Update CODING_STANDARD.md #1959

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

Closed
wants to merge 2 commits into from
Closed

Conversation

majakusber
Copy link

In Doxygen comments, we do not have much consistency about whether or not to use a colon after a parameter name. This PR suggests to not use the colon as it looks a bit weird in the documentation and the doxygen manual does not use it:
https://www.stack.nl/~dimitri/doxygen/manual/docblocks.html
On the other hand the argument to use it would be that it's more readable in the code. A way to increase readability without the colon could be to align the parameter descriptions using indents.
Express your opinion.

@owen-mc-diffblue
Copy link
Contributor

I prefer with colons.

@hannes-steffenhagen-diffblue
Copy link
Contributor

hannes-steffenhagen-diffblue commented Mar 22, 2018

My preference is to not use colons,because it doesn't really improve readability in the code.

If you want some separation between parameter name and description, instead of a colon I'd recommend adding the description on the next line and indenting two spaces (doxygen doesn't care about whitespace mostly)

@romainbrenguier
Copy link
Contributor

romainbrenguier commented Mar 22, 2018

Why do you say they look weird in the documentation?
this looks normal to me http://cprover.diffblue.com/classstring__refinementt.html#a8a2ac48211dc5f85be38bfa80338f2db

@hannes-steffenhagen-diffblue
Copy link
Contributor

It's not the doxygen generated documentation actually, but it does affect the CLion version

@majakusber
Copy link
Author

majakusber commented Mar 22, 2018

This is the example that I was given where the colons do show:
http://cprover.diffblue.com/invariant_8h.html#a66872166e18e5b1c3a087f532078b803

@romainbrenguier
Copy link
Contributor

This is the example that I was given where the colons do show:
http://cprover.diffblue.com/invariant_8h.html#a66872166e18e5b1c3a087f532078b803

That's because there is a space between the parameter name and the colon

@majakusber
Copy link
Author

So a solution could be then to edit the wiki to say something like - if you choose to use the colon then do not put space there. Would that still be considered inconsistent use? @peterschrammel

@peterschrammel
Copy link
Member

peterschrammel commented Mar 22, 2018

Yes, it seems that doxygen correctly removes the colon only when there is no space between parameter name and colon. I'd go for that. no space + colon.

@owen-mc-diffblue
Copy link
Contributor

owen-mc-diffblue commented Mar 23, 2018

I am against allowing both with and without a colon. I think we should standardise on one. I prefer a colon, but I appreciate that this is a personal preference.

reuk introduced the current format in #869 . It seems he based it on LLVM's format, but that doesn't seem to have the colon, so either he added it or they used to have it and have got rid of it since then.

@majakusber majakusber closed this May 9, 2018
@majakusber majakusber deleted the patch-1 branch May 9, 2018 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants