View Poll Results: How do you indent?

Voters
34. You may not vote on this poll
  • Tabs

    19 55.88%
  • 1 space per level

    0 0%
  • 2 or 3 spaces per level

    6 17.65%
  • 4 through 6 spaces per level

    7 20.59%
  • 7+ spaces per level

    2 5.88%

Thread: How do you indent: spaces or tabs?

  1. #46
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    Quote Originally Posted by zacs7 View Post
    On a side note, who uses black backgrounds for their coding window? I find it's easier on my eyes.
    I've used it pretty much all my life. Always around some sort of small variation of this style. Except back in the days when we had little choice and it was either white on blue, or green on black.

    But recently I've been having problems with it. I'm getting tired faster and, I reckon, having more trouble concentrating with it. My ophthalmologist insists it's the fact I'm getting old and the quick variations between dark and bright white when switching between the editor and the web or other materials is not being taken easily anymore by my eyes.

    I have been doing some forays into lighter backgrounds, while making sure I do not increase the contrast too much, testing some possibilities until I settle with something I like. Currently this is what I have, but still working on it. I'm not entirely satisfied yet.

    OldBrownEyes Scheme:
    The font is Dina. Scientifically proven by the major makers of software to be the best font to protect your code from corrosion and calcium oxide while leaving a good natural smell and protecting the environment.
    Last edited by Mario F.; 09-23-2009 at 08:07 AM.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  2. #47
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Quote Originally Posted by zacs7 View Post
    On a side note, who uses black backgrounds for their coding window? I find it's easier on my eyes.
    Me too. I had thought this was scientifically proven, but after googling around it looks like the world is split on the issue and there is no evidence, beyond personal preference, to justify either dark on light or light on dark.

    I'm also sold on large fonts; I used to use normal fonts and then just jack them up sometimes when my eyes got tired. Now I just leave them all large all the time and hey! my eyes never get tired.

    ps. great vim tip, thanks! I use all tabs, but at least I can see them now. Apparently this has it's own highlight class:
    Code:
    :highlight ExtraWhitespace ctermbg=darkblue
    Last edited by MK27; 09-23-2009 at 07:31 AM.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  3. #48
    Registered User
    Join Date
    Jul 2007
    Posts
    131
    man 9 style

  4. #49
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    2,158
    I agree that white-on-black is nicer on the eyes, but for some reason, I find it more natural to read thinner fonts on black-on-white.

    Mario, nice theme, you should try adding a little more green to it, the preprocessors would be a good place.

  5. #50
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    No one is extreme enough to use 1 space for indenting.

    Which is odd since it's the optimal indent level for a small file size, while still having indenting

  6. #51
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Quote Originally Posted by zacs7
    Which is odd since it's the optimal indent level for a small file size, while still having indenting
    Using tab characters would result in the same small file size with indentation that is easier to spot. But "small file size" is a poor argument anyway.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  7. #52
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    Quote Originally Posted by laserlight View Post
    Using tab characters would result in the same small file size with indentation that is easier to spot. But "small file size" is a poor argument anyway.
    Yes, yes, I meant with spaces. Oh well, curse my ambiguity. And of course it's a poor argument, so is using 1 space :-)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Changing 3 spaces to tabs
    By dnguyen1022 in forum C Programming
    Replies: 2
    Last Post: 12-22-2008, 12:51 AM
  2. Tabs or Spaces
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 46
    Last Post: 04-08-2007, 11:45 AM
  3. Visual C++
    By Golffor1 in forum C++ Programming
    Replies: 1
    Last Post: 08-04-2003, 04:30 PM
  4. tabs to spaces with dev c++ v.4
    By stallion in forum Windows Programming
    Replies: 2
    Last Post: 01-28-2003, 02:07 PM
  5. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM