Adding an Edit feature to cplusplus

Pages: 12
5? Who would want to indent by an odd number? That's just silly.
An odd number is just fine as long as it's evenly divisible by 5.
Spaces are less flexible because they always appear the same, whereas tabs appear however the viewer likes.

Elastic tabstops seem pretty cool but sound like it'd be annoying to set up in the first place.
An indent of 8 spaces is ridiculous. Code is not a TABle, after all.

I myself use a 3 space indent. It's clean and doesn't get messed up when I paste it here.
After http://www.cplusplus.com/forum/lounge/76551/2/#msg412078 I've been posting with 3 space indent to annoy people.
I understand spaces for aligning assignment operators and such, but for start-of-the-line indenting I can't understand why people would use spaces.

I use tabs for the following reasons:
1. If I am 3 indents in, I don't want to be mashing and counting 3*(tabSize) spaces. It's a waste of my time, keyboard and counting.
2. The text editors I use all auto-indent with TABS. I'm not going to give up auto-indenting or visual studio/notepad++ for this.
3. When its the start of a line, who cares how big the TAB is? It can vary depending on the user's preferences (that being said, 8 is wayyyy too much).

Why do you space-purists prefer spaces?

Ahhh, isn't that interesting, I just found a "replace tab with spaces" feature in visual studio. I'll try it out and see if I like it. Even if it simply prevents me from consistently CTRL+H'ing my code so that I can put it on this forum, it'd be useful.
Last edited on
@Stewbond
1. Most editors can treat groups spaces as if they were tabs. CodeBlocks' editor does. gedit, which I use, doesn't, but it does have an unindent function (shift+tab) which unindents an entire block of code. If not, just hold/tap backspace until the text after the cursor is aligned with the right indentation level (if you have other code at that level to use as a guide, or if you have indentation guides on your editor). Alternatively, what I do for single lines is to press shift+home and then press backspace or delete. In short, learn to use the keyboard shortcuts.
2. You should be able to configure them to use spaces. I'm fairly sure notepad++ can.
3. 8 is the standard.

Stewbond wrote:
Why do you space-purists prefer spaces?

I started with spaces, but then I switched to tabs. I switched back to spaces because I didn't want to stop using spaces for pretty-printing and I didn't want to mix tabs and spaces (because it leads to weirdly-aligned code when some blasphemous fool uses a different tab size). You're right that 8 columns is too much for a single indent, but I still firmly believe that 8 columns is the one true tab size, so the only way to use smaller (or larger, if you are so inclined) indentations is with spaces.
Last edited on
I don't understand your point #1, chrisname.
You just described several ways of losing time when indenting with spaces.
No I didn't.
Topic archived. No new replies allowed.
Pages: 12