-
Notifications
You must be signed in to change notification settings - Fork 0
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 Style #1
Comments
Thanks for @agudmund for sharing the performance concern with using mixed cases in file- and directory names. http://www.open-e.com/site_media/download/documents/Manual_OE-DSS-V7_BAS_EN_1_00_r1.pdf From the chat:
|
In regards of braces, I always loved to have them in the same level of indentation (for the sake of clarity). Having said that, int main() {
printf("hello, world\n");
} |
int main() {
printf("hello, world\n");
} This one is more common in many IDE, who support auto-complete. |
How about choosing a "mentor", some library/software with an already established coding style, and then sticking to that until we find any reason to deviate. QtFor example. There is also this. They both relate to C++, but I figure since we're heading there eventually, it might be good to get into the habit early. Thoughts? |
Here's some perspective on the Google Style Guide. |
The idea of choosing a "mentor" and sticking to that until we have a good reason not to do that sounds good to me. Personally I think that the most important thing to remember is to keep consistency across all of our projects. I think that the lack of consistency is the first step towards unmaintainable code. HERE is an interesting and fun read in regards of maintainability. |
This sounds good, and I agree, but seeing as none of us know C very well I'm sure our code and conventions will change in time and that it will change for the better. I wouldn't want to be stuck with conventions we come up with today down the road when I actually know what I'm doing. I guess what I'm saying is, our projects will likely differ in style, and that there isn't too much we can do about it, other than embrace it as a sign of maturity. As long as we keep our guides clear and concise, we should do well. |
Absolutely. I expect our code and conventions to change in time as well and that's just fine. 👍 |
Right off the bat there are things to discuss, lovely. :)
Filename convention
Currently the filename is snake_case, like Python. What is the pros/cons of this, as opposed to mixedCase.c or simply nocase.c? What is more common and accepted?
Case
Within the code, let's have a think about what case is mostly used today, by looking at other established codebases. Looking at Qt and C++, it looks like mixedCase is preferred, for example.
Braces
Or
Personally, I prefer less lines, but let's have a chat about what is more common.
Summary
Is it a good idea to try and establish a convention for ourselves to follow throughout the series of projects?
The text was updated successfully, but these errors were encountered: