View Full Version : Tab Spacing
09-15-2007, 12:17 AM
Just a thought, any way to tone down the amount of spaces a tab character has in a code block. In my text editor it's only 3 spaces, and I think normal tab is maybe 8? So when I paste my code it indents like crazy. :(
09-15-2007, 01:35 AM
Actually, it depends on setting. The normal ASCII standard was 8 spaces, the most common among programmers is 4, though some HTML editors prefer 2. Some projects like to have tabs autoadjust (many LISP prettyprinters for instance). You can't change the size for every viewer unless the program they're using has parsing for prettyprinting mode, and your generating program inserts a comment of the right format.
So, the best solution if the distance is actually important is to stop using tabs and start using spaces.
09-15-2007, 05:42 AM
It doesn't really bother me, just sometimes when code is nested deeply it will create a side scroll bar and make it difficult to read. I think my text editor; Ultra Edit actually has a setting to treat tabs as spaces. I'll turn it on, thanks.
09-15-2007, 07:16 PM
Oh no, I sense a tab vs. space debate coming on!
Me personally, I use tabs in all my code and have my editor to "interpret" them as 4 spaces. BUT, I work with other developers who use spaces, and they take my "tabbed" code and their editor changes it into 8 "spaces" per tab, then I go back an look at the code and it's blown way out. Really bugs me too.
09-16-2007, 04:21 AM
Me personally, I use tabs in all my code and have my editor to "interpret" them as 4 spaces.
My editor uses 4, and that seems to be the standard from what I've seen. I tried several different ones and only a few used a different number. I think I actually changed the setting in UltraEdit to 4 because it bugged me so much.
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.