Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5

Thread: Tab Spacing

  1. #1
    Smokes a Lot
    Join Date
    Jul 2003
    Location
    CA, USA
    Posts
    1,594
    Thanks
    5
    Thanked 20 Times in 20 Posts

    Tab Spacing

    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.
    Helping to build a bigger box. - Adam Matthews

  • #2
    Master Coder
    Join Date
    Feb 2003
    Location
    Umeå, Sweden
    Posts
    5,575
    Thanks
    0
    Thanked 83 Times in 74 Posts
    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.
    liorean <[lio@wg]>
    Articles: RegEx evolt wsabstract , Named Arguments
    Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
    Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards

  • #3
    Smokes a Lot
    Join Date
    Jul 2003
    Location
    CA, USA
    Posts
    1,594
    Thanks
    5
    Thanked 20 Times in 20 Posts
    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.
    Helping to build a bigger box. - Adam Matthews

  • #4
    Mega-ultimate member
    Join Date
    Jun 2002
    Location
    Winona, MN - The land of 10,000 lakes
    Posts
    1,855
    Thanks
    1
    Thanked 45 Times in 42 Posts
    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.

  • #5
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,642
    Thanks
    2
    Thanked 405 Times in 397 Posts
    Quote Originally Posted by bcarl314 View Post
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •