Tab characters should take up less space in Output

This image shows what happens when you print one or two tab characters:

That’s a ridiculous amount of whitespace. Can this be reduced? According to my calculations, tabs are equivalent to 40 spaces:

print(string.rep(' ', 40) .. 'x')

Both Xs are indented the same amount in my Studio.

1 Like

I just tried it and wow, that’s a lot of whitespace.

(by the way this is just ONE tab)

the tabs need some quelling on the dev forums too


[quote] the tabs need some quelling on the dev forums too

thisisonetabwhyamIsolong [/quote]
By the looks of it the dev forums use 8-character-wide TABs.

At University, we have to use 2 spaces for indentation, which I hate because

A ) I find that code is almost unreadable, if a block is more than 2 or 3 lines I always end up having to count braces.

B ) Visual Studios decides 80% of the time that they are spaces, so to outdent you have to press backspace twice.

I find a tab equivalent to 4 spaces much more readable.

    int x = std::sqrt(-1);

well they’re wrong.

well they’re wrong.[/quote]

Yes, but I have to ;(

well they’re wrong.[/quote]

Yes, but I have to ;([/quote]

Which university? And which teacher? Is it a school-wide thing, or just for that teacher?

Only one person, but they are marking the exams. :stuck_out_tongue:

I can’t wait for second year compiler writing…


[quote] the tabs need some quelling on the dev forums too

thisisonetabwhyamIsolong [/quote]

This is quite amusing. I have a userscript which converts hard tabs to 4-space soft tabs on RBXDev. So, when I see this, there is nothing wrong :slight_smile:

This is the classic case of not understanding what tab characters are for normally in an output. This shouldn’t be changed for the same reason that the tab stop width can’t / shouldn’t be changed in internet browsers: You’re looking a the world through code-editor tinted glasses, and code editors make a rather non-standard usage of tabs compared to what they are used for elsewhere.

Tabs are not normally used for small indentations like they are in a code editor, the purpose of a tab character in an output like the output window is to advance the cursor to the next “tab stop” in the output, not to provide a small indentation. The idea is that you can use it to align entries when outputting tabular data something like this:

value1 value2 bb
blah blue cc

The result of that output will be that “bb” and “cc” are aligned in the output, which would otherwise be rather difficult to accomplish. That’s where the name “tab” comes from, “tabular”.

TL;DR: The solution to your problem is to use spaces for indenting the start of lines, and tabs for tabular like they’re meant to be used for, not to change the tab-stop width in the output.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.