Skip to content
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

C/C++ style guide #7

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

C/C++ style guide #7

wants to merge 6 commits into from

Conversation

baloian
Copy link

@baloian baloian commented Apr 15, 2017

C/C++ style guide for Secure Systems Lab.

  • Added C++_Style_Guide.md file.

  • Wrote C/C++ style guide

Please have a look and write a comments.

Artyom Baloyan and others added 6 commits April 14, 2017 23:12
- Wrote C/C++ style guide rules.
- Made some correctness of lines
- Fix size of See Also
@JustinCappos
Copy link
Contributor

JustinCappos commented Apr 15, 2017 via email

@baloian
Copy link
Author

baloian commented Apr 15, 2017

Actually books are not directly related to style guide, though most of security style guide rules were taken from Mayer's books. The idea is that to provide resources in order to became more professional developer in C/C++. It is not necessary, but it is good practice. What do you think @JustinCappos ? May would be better to change a title little bit instead of saying just See Also ?

Things about error handling, clarity of comments, etc Google style guide provides. For example, I just put here one line

"Do not state the obvious. In particular, don't literally describe what code does, unless the behavior is non-obvious to a reader who understands C++ well. Instead, provide higher level comments that describe why the code does what it does, or make the code self describing."
https://google.github.io/styleguide/cppguide.html

Do you think it is not enough ?

@JustinCappos
Copy link
Contributor

JustinCappos commented Apr 15, 2017 via email

@vladimir-v-diaz
Copy link
Contributor

Are there guidelines in Google's C++ doc that we might want to modify or explain further? For example, Google's guideline on vertical whitespace differs a bit with the one we follow for Python, where we advise developers to separate top-level functions with at least 5 blank lines. In contrast, Google's doc simply says to minimize vertical whitespace.

We should also cover, in our doc, some of the more important guidelines. What about topics not covered in Google's guidelines? Although not really a style guide, how should we handle testing? Do we want to use the same testing framework across all projects? How should developers write a function and their tests?

@baloian
Copy link
Author

baloian commented Apr 19, 2017

I am not sure that it is a good idea to change something in Google Style Guide, because we follow the same rules in Python in a different way and in general I think it would be better not to compare C/C++ with Python, just let's see it is as a C/C++ language (Joke: let's think like a compiler not like an interpreter).

I will check that topics is not covered in Google's guideline that we have in our current guidelines and let you know.
About handle testing and testing frameworks I would like to see here @JustinCappos's opinion too and then I will offer you guys some options.

@JustinCappos
Copy link
Contributor

JustinCappos commented Apr 19, 2017 via email

@baloian
Copy link
Author

baloian commented Apr 19, 2017

The idea/reason is to keep Google style guide as it is, but if would like to add some other extra rules which Google style guide does not contain let's do it, like we did with security rules.

@JustinCappos
Copy link
Contributor

JustinCappos commented Apr 19, 2017 via email

@vladimir-v-diaz
Copy link
Contributor

I prefer vertical whitespace between functions/classes

@aaaaalbert
Copy link
Contributor

So do I!

@JustinCappos
Copy link
Contributor

JustinCappos commented Apr 19, 2017 via email

@SantiagoTorres
Copy link

I'm a little bit skeptical about adding the Google C++ guideline in certain cases, I'd disambiguate claims like these:

Classes are the fundamental unit of code in C++. Naturally, we use them extensively. 

As they seem to be completely opposite to what we suggest in other guidelines.

@JustinCappos
Copy link
Contributor

JustinCappos commented Apr 22, 2017 via email

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