-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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 Styling - Tabs Versus Spaces #3426
Comments
"switching to spacing (e.g. 4 spaces instead of the default tab width of 8) can prevent the code from "walking too far to the right"." Can't this be fixed by adjusting tab width in your editor of choice? I don't see any argument for spaces unless they've been used in the past and we're keeping consistency. |
That depends on - what you consider the "editor"
+ what you consider the"editor" ... since GitHub is what PR reviews are performed on.
The S.O. article here mentions a few good arguments for both sides. |
I sure do love me my spaces, and I have to switch my preferences in vim just to do stuff in LMMS. However, I think efforts can be better spent elsewhere. |
@tresf seems github tab size can be changed. http://stackoverflow.com/questions/8833953/how-to-change-tab-size-on-github/23522945#23522945 |
I use Atom which automatically recognizes the indentation, so I'm fine either way. I don't see why QtCreator taking 4 steps to switch to tabs should affect the coding conventions, also I haven't seen too many devs using it really. If we switch to spaces, all of the active Pull Requests would need to get changes as well as every file in the codebase. In my opinion, not worth the effort. |
Not true! Code standards should happen gradually over time.
Thanks however that's per hyperlink, not very useful.
That sound like a very nice feature!
It's a standardization question only. This isn't meant to be a sweeping change. |
The decision doesn't have to be influenced by QtCreator, it is only what sparked the question. As I stated, all of my other editors default to tabs. I simply want to get a feeling for how people are handing this problem today. |
As for me, tabs are better, because everybody can adjust their width in text editor so, as is maximally comfort to him. |
Closing this to keep the tracker clean. There isn't enough consensus to change the standard now but people are free to chime in. It sounds like Qt's settings are global which seems like a bad IDE design. I use a proprietary editor for some other projects and it lets you easily define this setting at a project-level as well as what I consider superior GitHub integration... however... I know there are mixed feelings with the group on proprietary applications so I don't feel the research is worth it at this point. If anyone's aware of other cross-platform C++ editors that work well, please mention them as well. At some point we need to make our project compilable (and editable!) in an IDE with minimal effort if we want to maximize productivity. Back on topic... Here's a quote from a previously linked article which I believe accurately describes my feelings on the topic.
|
I assume the decision to use tabs over spaces is historical due to the use of editors like
vi
.Since we're supporting many platforms and multiple versions of those platforms, configuring QtCreator for each machine can get tedious.
First, I'll make the assumption that QtCreator is the preferred IDE for most contributors. This has never been made official by the dev team (I personally use whatever is on the machine -- gedit, kate, notepad++, vi, TextWrangler) but I've spoken with many C++/Qt developers over the last year that use it exclusively, and now I'm starting to use it so it's the basis of discussion.
Currently, configuring QtCreator is a 4-step process.
The argument of tabs vs. spaces is a very old and often heated one but switching to spacing (e.g.
4
spaces instead of the default tab width of8
) can prevent the code from "walking too far to the right".A major downside to switching from tabs to spaces is it's not default for the majority of text editors.
Is this a standard worth changing moving forward? What is the primary IDE of choice among developers and how do you handle this problem in other large projects?
This isn't meant to start any flame wars. I'm well aware this is a sensitive topic.
The text was updated successfully, but these errors were encountered: