Style guide
Moderator: PPS-Leaders
Style guide
I just wanted to have a look at the coding rules from yesterday:
http://www.orxonox.net/wiki/CodingRules
But this is definitly not the document we've seen. ("{" in while or if, the last part of the document..)
So: where is the actual one?
Edit: Found it: http://www.orxonox.net/wiki/c%2B%2B_styleguide
But how can one find it without the timeline?
http://www.orxonox.net/wiki/CodingRules
But this is definitly not the document we've seen. ("{" in while or if, the last part of the document..)
So: where is the actual one?
Edit: Found it: http://www.orxonox.net/wiki/c%2B%2B_styleguide
But how can one find it without the timeline?
I've just come across a 'problem' with Doxygen: It is possible to write a comment for a function in the header file and in the code file.
Now, on the doxygen homepage there is a description of what will be taken in this case (Brief descrition from header, detailed one from the source).
Since I haven't programmed with doxygen at all, I ask the experienced ones: Where shall I place my comments with @param, etc.? Is it better to keep everything in the header files in order to make it easier for external programs? Or is in that case the readability of the source code restricted? Anyway, copying comments would not be my preferred solution.
Now, on the doxygen homepage there is a description of what will be taken in this case (Brief descrition from header, detailed one from the source).
Since I haven't programmed with doxygen at all, I ask the experienced ones: Where shall I place my comments with @param, etc.? Is it better to keep everything in the header files in order to make it easier for external programs? Or is in that case the readability of the source code restricted? Anyway, copying comments would not be my preferred solution.
Re: Style guide
Personally I prefer to put the "{" on a new line, but that's one of the less important points in the styleguide1337 wrote:But this is definitly not the document we've seen. ("{" in while or if, the last part of the document..)
Re: Style guide
Agreed. I'm so used to putting '{' on a new line...x3n wrote:personally i prefer to put the "{" on a new line, but thats one of the less important points in the styleguide1337 wrote:But this is definitly not the document we've seen. ("{" in while or if, the last part of the document..)
So change it accordingly. You guys wouldn't have gotten the rights to do that what you can do if we would not want you to do it .
I agree with the "{" I'm used to do it both ways, but I learned it like you guys in the olden days.
About the doxygen: I'd put everything at the beginning. Then nobody has to search for the stuff, but has it right at the top. IMO...
I agree with the "{" I'm used to do it both ways, but I learned it like you guys in the olden days.
About the doxygen: I'd put everything at the beginning. Then nobody has to search for the stuff, but has it right at the top. IMO...
"I'm Commander Shepard and this is my favorite forum on the internet."
About the style guide and the '{': I don't think that this is important enough to define a clear rule. I wouldn't mind, if we did that mixed ways.
However, the '{' in a function is quite important, since it structures the code.
And by the way: I really don't think if everyone changes the style guide according to one's preferences. Lets put such things in this thread in order to discuss it first.
Oh, @beni: what exactly do you mean by "put everything at the beginning" with Doxygen? The comments for the functions certainly should be above each function, not at the beginning of the file.
My question actually was wheter to put the Doxygen comments in the the header files or in the source files.
However, the '{' in a function is quite important, since it structures the code.
And by the way: I really don't think if everyone changes the style guide according to one's preferences. Lets put such things in this thread in order to discuss it first.
Oh, @beni: what exactly do you mean by "put everything at the beginning" with Doxygen? The comments for the functions certainly should be above each function, not at the beginning of the file.
My question actually was wheter to put the Doxygen comments in the the header files or in the source files.
Oh I thought you meant at the beginning of the function or inside the function. If I'm not mistaken one can put stuff for doxygen inside a function.
I think a short description in the header file and a detailed one in the source file is the best, as suggested on the doxygen site.
I think a short description in the header file and a detailed one in the source file is the best, as suggested on the doxygen site.
"I'm Commander Shepard and this is my favorite forum on the internet."
I feared so.
For the rest, I'll keep it short since I have already written it all once (just clicked wrongly on a button on the page, schwups, everything was gone):
- deleted "main_reto", added a real branch "main_reto" and "main_reto_vs05", in which I keep my up-to-date files for now
- make... that's gonna cost me a lot of time to understand and to set up MinGW with gcc (the latter being the small problem).
- Everything edited to fit the style guide more or less.
- Every function now has a comment.
btw: sorry for the missing svn comment for the last commit. I had it all written nicely, but there was an error during the commit (version mismatch...). So I updated and then commited again, this time hitting OK very quickly... Curiously, nobody has commited anything today except me..
For the rest, I'll keep it short since I have already written it all once (just clicked wrongly on a button on the page, schwups, everything was gone):
- deleted "main_reto", added a real branch "main_reto" and "main_reto_vs05", in which I keep my up-to-date files for now
- make... that's gonna cost me a lot of time to understand and to set up MinGW with gcc (the latter being the small problem).
- Everything edited to fit the style guide more or less.
- Every function now has a comment.
btw: sorry for the missing svn comment for the last commit. I had it all written nicely, but there was an error during the commit (version mismatch...). So I updated and then commited again, this time hitting OK very quickly... Curiously, nobody has commited anything today except me..
I have a suggestion for the namespace part in the style guide:
Don't write "using namespace ..;" in header files because otherwise if someone included that header file, the "using namespace .." would automatically be included as well. That may lead to unwanted errors.
I'm not sure whether I'm telling crap, because if you don't write "using" in header files, you'll have to write e.g. Ogre:: many times... Although I don't think that is such a problem considering the side effects of "using".
Don't write "using namespace ..;" in header files because otherwise if someone included that header file, the "using namespace .." would automatically be included as well. That may lead to unwanted errors.
I'm not sure whether I'm telling crap, because if you don't write "using" in header files, you'll have to write e.g. Ogre:: many times... Although I don't think that is such a problem considering the side effects of "using".
ok, the last part is crap for my work in the last few hours... But no problem to fix: find and replace through files...
But I agree: even though Ogre and OIS are upper case, lowercase makes more sense:
namespaces -> Classes -> variables and functions
Ha, already done
edit: added the '_s' postfix to clarify static class variables.
But I agree: even though Ogre and OIS are upper case, lowercase makes more sense:
namespaces -> Classes -> variables and functions
Ha, already done
edit: added the '_s' postfix to clarify static class variables.
Who is online
Users browsing this forum: No registered users and 1 guest