-
Notifications
You must be signed in to change notification settings - Fork 268
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
Code-style : proposed change to K&R #166
Comments
Maybe some peices of my code was written in different style (last years I used strong-defined code style on a really big project - it is difficult to immediately change the style). Some things I don't like in current style:
if (a > 2)
{
b = funcB(3);
}
else
{
b = funcB(4);
} or if (a > 2) {
b = funcA(3);
} else {
b = funcB(4);
}
we used this style because newbies sometimes confused about what star does mean |
I am not against a different style, just my subjective thoughts |
I'm happy to work with whatever you folks finds most comfortable. . . Let's stick with one though. (It's a shame the IDE can't personalize for you, but save in a standard format) Folks want to change to KnR style? It's more common. Sent from my iPhone
|
Are there guidelines for the code style? Does the AppCode solution have those? (normally using Xcode here). I have started using ObjClean which warns you when you are breaking the code style. Maybe we can write a summary of the ObjClean questions for the project (a short-ish code snippet should show most of the code style decisions). But first it will be good to know if there is already a code style in place. I try to follow the code around where I’m editing, but sometimes I see contradicting code styles. |
I actually worked with Lisa helping her to do the objClean Xcode integration (using my Xcode API project) so she owes us a favor ;) Personally I like the "just format it for me" approach like AppCode or Uncrustify. . there's an Uncrustify plugin for Xcode and a GUI that would certainly allow mirroring the same setting we have in AppCode Sent from my iPhone
|
Robert and I did set up a code style and formatting rules. Rules were checked in and the ticket was #98, I think. Sent from my iPhone
|
Perfect. I will look at the formatting rules in AppCode and write a short “textual” guide. Then I may commit the ObjClean file, but I think I will let the integration out (to not force everyone to run that build step). |
Following as close as possible the AppCode style settings already present. See appsquickly#166
So I included the ObjClean plist (as close as I could for the AppCode styles), and a short note in the contributing guide. Anyway, I will try to use AppCode more, so it maintains the style more consistently. |
@drodriguez Use whichever IDE your prefer. . . we've got all the team members we can handle now (or have we?!) , but I still envision other folks contributing patches and pull requests. . . many of those folks might prefer Xcode like yourself. . So the work you've done is very useful. |
Ideally we shouldn't need a separate code style guide, but at the moment when the styles used in the codebase are somewhat inconsistent it should help. Good work! I do use K&R style in my own projects and would be in favor of changing to it. However, the most important thing is consistency. |
I've used both styles in the past and find that:
Happy to change to whatever the general consensus is. Sent from my iPhone
|
Ok folks, let's decide. Cast one of the following votes:
|
Don't care |
Regarding order of .h file and .m file - this is something that AppCode does. . I've reported a bug. Will bump the issue. |
K&R |
Don't care. As long as we are consistent. |
I was going to wait for Daniel's vote but it looks like Aleksey (you damn renegade Aleksey! ;) ) has checked in his code-style settings again. . . . let's just run with K&R. |
Just joking - I don't know how the code-style got checked in. . . but let's run with it anyway. I get the impression that most folks are leaning towards K&R/don't care. . . |
Here's a nice auto-format tool if you prefer Xcode: https://github.com/travisjeffery/ClangFormat-Xcode |
Hi folks, I thought we decide to use K&R style.
But after reformatting I see different style - each method has its opening brace on the same line.. Jasper, could you check style settings and reformat code again? |
OK done. Let me know if you see anything else. |
Hi Folks, (AppCoders especially)
Not sure why, but it looks like the code-style is changing. . . anyone check in their personal settings to the project by accident?
I’m happy to change the style, but we should choose something and stick to it.
#98
The text was updated successfully, but these errors were encountered: