indragiek / INAppStoreWindow

NSWindow subclass with a highly customizable title bar and traffic lights
BSD 2-Clause "Simplified" License
1.06k stars 162 forks source link

Switch from tabs to spaces. #160

Closed jakepetroules closed 10 years ago

jakepetroules commented 10 years ago

Spaces are default and preferred in Xcode for Objective-C (and most style guidelines in general). Tabs are preferred for plists.

indragiek commented 10 years ago

I'm gonna have to think on this one for a bit :grin:

jakepetroules commented 10 years ago

You can see from the diff that even GitHub prefers spaces. :)

Notice (tabs)

void function(void *param1,
                            void *param2);

vs (spaces)

void function(void *param1,
              void *param2);
jakepetroules commented 10 years ago

Please "decide" about this soon too. :P

indragiek commented 10 years ago

Weirdly enough, GitHub's own Objective-C style guidelines (which I tend to follow pretty closely) recommend tabs over spaces :P

jakepetroules commented 10 years ago

I consider Apple/Xcode defaults more authoritative. :)

Also, some random Apple Open Source files:

http://www.webkit.org/coding/coding-style.html "Use spaces, not tabs. Tabs should only appear in files that require them for semantic meaning, like Makefiles."

http://llvm.org/docs/CodingStandards.html#use-spaces-instead-of-tabs "In all cases, prefer spaces to tabs in source files. People have different preferred indentation levels, and different styles of indentation that they like; this is fine. What isn’t fine is that different editors/viewers expand tabs out to different tab stops. This can cause your code to look completely unreadable, and it is not worth dealing with."

github/objective-c-conventions#57

indragiek commented 10 years ago

I'm going to have to close this one. I realize that Apple prefers spaces over tabs, but they're just one entity and many different places have different conventions. I don't think there is a "correct" choice because it's a purely subjective decision. I personally have been using tabs in all my projects for a while now, so I'm going to stick with tabs to keep consistency with my own style (which doesn't agree with Apple's, but I don't consider using tabs to be "wrong" in any form).

jakepetroules commented 10 years ago

Oh well, at least I tried to convert you to the the Right Way® :)

The project is still inconsistent though, so we should make sure ALL files are tabbed (and maybe this related to #154, but I could only find tabs > spaces examples when I looked, not the inverse).