ObjClean
objclean.com
objclean.com
My co-founder is also a long-term Objective-C developer and we have different "styles" of programming. When I write code I care about style but only to a certain extend. When I edit my co-founder's source code I simply adopt to his style and that's it. No need to "formalize" anything as long as no really dumb code formatting rule is used that has real technical drawbacks like:
if(expr)
doThisOneLinerWithoutCurlyBraces();
I worry much more about the architecture, correctness and good names for things these days...A tool like this certainly has its benefits though. Depending on how experienced your team is you want to give junior developers automated guidance.
What would be really cool though is if the formatting rules were applied by Xcode itself. Then each team member could have individual coding style settings. Before pushing to git a "company wide" rule would be applied. This has drawbacks as well: gif giff becomes less useful for sharing between co workers, debugging information is out of sync...
I agree with what you're saying though. Making whitespace differences into a build break seems to miss the point a bit. Is that what the author thinks "clean code" means? Consistent whitespace and nothing more? Consistent whitespace is certainly a good idea but there's so much more to a sane code base than how many newlines follow a declaration or whatever.
I'm sure you and the GP would never forget to add curly braces when inserting an else, but the junior developer who comes afterwards might, and it's just not a huge deal to have the braces because it's two extra chars.
Quite frankly the Linux kernel coding style is wrong on this one in general, I guess we can assume they are experienced enough to put braces in when adding an else clause and so it's not going to cause them errors. But with junior devs it certainly could.
{if (condition) singleFunctionCall();}
I took the survey. A few comments:
The early questions show only one sample option. If I remember my survey design fundamentals, there will likely be a bias in the results for the answer that matches the sample. This is especially confounding because, as I interpret it, the sample shown is also the probably-most-common preference.
Later questions have display samples of A, B, C, ... form. Some of the samples aren't labelled. Minor oversight that the audience should be able to handle, but it's a source of error.
I'd really like to be able to see the compiled results. Downloading the rulesets is great, but a browser-digestible form with response weightings would be much more generally useful.
Also, I can't see the MAS from my iPad, so I can't see the product page. Some details on the website would be awesome. I think I get it, it's an Xcode plugin to style-lint my code. How much does it cost? Can it autofix, a la gofmt?
Even Apple's sample code is full of stylistic inconsistencies, some of which are distant echoes of K&R vs ANSI C. I like style guides, especially those that I can customize to my liking.
Click here to view/edit your responses and compare them against the stackoverflow
matrix, as well as the total site average.[1] http://en.wikipedia.org/wiki/Clean_(programming_language)
They've said they're adding it, but it's going in my later list until they get around to it.
http://i.imgur.com/U1i7vlU.png
Disclaimer: I'm in no way affiliated with the developers, I just find it to be an underrated/overlooked Obj-C IDE.
I haven't tried sharing these styles across the team who uses AppCode. I'd really like to be able to share styles across IDEs: if some of the team uses XCode they could use the style I've defined. But I don't see a way to share these cross-tool either.
Even Uncrustify integration (export?) for Appcode would be nice, but it's missing. Heck, I'd even like Uncrustify in AppCode, but haven't found a plugin for it.
I would much rather it showed warnings, so that I can choose to ignore them if I think an exception to the rule is better in a specific case. Perhaps it would be nice if the tool even respected some sort of pragma mark, or other preprocessor statement so that it can be disabled or partially restricted for specific parts of the code.
Ideally though one should be able to switch between different styles. I take it that ObcClean only points the errors out and won't go as far as to correct them/put them all in one style for you? If not that would be cool.
I use 2 Xcode Plugins right now: XcodeColors and XAlign.
This could be my third. However, it goes against some XAlign features.
Free app code / $.99 cent sale?
If the diff is full of additional formatting/stylistic changes, it can make it a lot harder to cut through the noise and get down to the heart of the change.
I'm not saying you should never clean up old code/files, however when I see that needs to be done, I try to do it in a separate commit that I make after the "real" change. The log message for that change is something like "Formatting", or "Cleanup, no functional changes".
However, because the entire code-base was cleaned up at once we now have no additional noise from Uncrustify being run on our commits. The only changes to style it will ever suggest are with your current changes you are attempting to commit since everything in the repo right now is "clean".
plus a findbugs plugin for static analysis(rather then style issues).
These tools basically makes these things visible and harder to ignore.
If the tool reformatted however, I'd have a totally different feeling. That would be great, that it auto goes to some pre-determined, "ok" style for the team without wasting programmer effort doing it.