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
Coding Standard #307
Comments
What standards are you intending to implement? |
it would be nice to even just have "conventions", e.g. |
I was thinking of something similar to what they have in the google code standard for C++: https://google.github.io/styleguide/cppguide.html |
I'm not the biggest fan of the spaces between the parenthesis and the function or keywords. In my opinion, it makes more sense to focus on naming conventions. I like snake case, you know something like int potato_count = 0; Of course, I think that classes should be upper case, and their methods, if they are more than one word, should be in snake case. class Window{
int get_width()const;
}; Though, given that this is written with Qt, I would rescind that recommendation and suggest that we follow the Qt naming conventions, so that would look like class Window{
int getWidth()const;
}; so you don't have to switch gears when you are writing code using the preexisting Qt classes and the ones that are written for Dwarf Therapist. |
I personally prefer
as opposed to
If the no spaces is a Qt convention though then I agree with you. |
I agree entirely with you @jaked122 , the naming conventions should be the primary concern at the time being.
The header files would look something like the above. We should stick to the basic Qt conventions like the |
@maksym-gryb Yep, it makes it a lot more convenient, doesn't it? Personally I don't usually put a @OdellDotson Well, that's not actually terribly relevant to us when we work with Qt's conventions (so far as I know), but I prefer to keep the brackets next to the name, as I see them as a sort of punctuation, and for the most part, punctuation is not separated from the word that proceeds it. It looks an awful lot like this Isn't that horrible looking? Besides, we should be able to make an astyle configuration that will enforce whatever style that we wish to use. |
Some of this such as spacing and indentation can be automated/enforced with clang-format. Although that does introduce additional dependencies (they're easy enough for OSX and Linux users), I've found it makes working on projects that have had many authors over a long period of time much easier to read. My 2¢. |
There is very little coding standard in between the Dwarf Therapist sources, since multiple people worked on it "separately" without agreeing to a single coding standard beforehand.
It would behoove of us to create one and so I shall (for the C++ at least).; as well as remodel the old code to the new standard.
The text was updated successfully, but these errors were encountered: