3 ms·
You're mixing up arguments. No one on your team should be changing indentations. You should decide as a team what your settings are going to be, that's why I su
by tinco 11y ago
You're mixing up arguments. No one on your team should be changing indentations. You should decide as a team what your settings are going to be, that's why I suggest using DetectIndent to make sure your settings match whatever the project guidelines are.
It's not a matter of personal preference though. Tabs are simply superior for encoding indentation. If you use tabs for indentation you can configure their width in your editor to match your personal preference, spaces doesn't allow for that. That's the only significant difference, and the only good reason for using tabs instead of spaces.
None of the arguments you made about spaces make sense. What's the fact that sometimes people mix up tabs and spaces got to do with anything? The whole idea of using tabs is that the code does format well regardless of what tab-width setting you have on your machine. Converting tabs to spaces does not require manual intervention at all. Alignment should be done with spaces, no one is argueing to use tabs for alignment. You can't use tabs for alignment because their width is undefined! The whole idea of using tabs is semantically encoding the authors original intention to allow you to reformat as you wish! At this point.. are you just trolling me?
- zo7 11y agoOh sorry! I completely misunderstood what DetectIndent was doing, that's a good tip. I did want to point out that there's some sense to forcing the code to look the same on every machine though. Of course converting tabs/spaces is automatic, but my point was that the mix of the two requires either manual editing or conforming to the width of whoever made the error. It does happen, and I've been on at least one project with a professor who would occasionally mix things up while in the throes of editing (and they used a tab width of 8 which made it especially irritating for others!). With spaces you at least force whitespace to mean only one thing and if you absolutely can't stand someone's indentation width you can still change it like you can with tabs. This really is personal preference though. Spaces explicitly represent the author's original intention including their indentation width, while tabs make it more convenient to others while conflating whitespace to mean two different things. Both are entirely reasonable though.
- ufo 11y ago> What's the fact that sometimes people mix up tabs and spaces got to do with anything? Its a concession to the fact that humans are imperfect. When I am working with a group of people I find it easier to just use spaces instead of relaying on everyone configuring to use tabs correctly.