Spaces vs tabs


(Calvin Krusen) #1

Where do people that use the tab key, but have the editor setup to convert tabs to spaces fall?

Are they tab people or spaces people?

I’d say they’re “lazy spacers”. They want spaces in their code, but too lazy to hit the space bar the multiple times.

Or possibly “closet spacers”. They have appearance of being a tab user, but secretly use spaces.


(Aaron Willett) #2

They’re ‘Tab People’ that want consistency across IDEs!


(Jason Stephens) #3

“Guilty pleasure tabbers” - they use tabs because it’s so satisfying and really the correct way to do things :wink: but want to look cool and edgy in front of their JS/Python friends.

Also, just going to leave this here to fan the flames…


(Chris Conn) #4

I use tabs for the consistency (and efficiency). Why press space 20 times when I can hit tab twice?


(Mark Wonsil) #5

If your editor is converting your tabs to spaces, then no reason. If your editor is storing the tabs in the file and other users have different tab stops, your pretty file ends up unreadable.

Spaces are for considerate people. :grinning:


(Calvin Krusen) #6

So youy’re saying you exclusively use the space key, and change the number of spaces you indent to match the existing code (when modifying someone else’s)?

And may I remind you, that you are under oath …


(Mark Wonsil) #7

I use Code Editors that auto indent - with spaces! :grinning: (Visual Studio, Vs Code, and Sublime Text all do this).

But if I’m creating a new indent, I used the space key. Ultimately, I’ll use a code-prettier to make it look nice. C# isn’t Python after all… :wink:


(Chris Conn) #8

Even if they have different tab spacing, why would it matter?
One sees:

void bool Test()
{
  bool ret = true;
  if(ret)
  {
     ret  = !ret;
  }
  return ret;
}

Another sees:

void bool Test()
{
      bool ret = true;
      if(ret)
      {
         ret  = !ret;
      }
    return ret;
}

(Mark Wonsil) #9

And no tabs set would see:

void bool Test()
{
bool ret = true;
if(ret)
{
ret  = !ret;
}
return ret;
}

(Brandon Anderson) #10

image


(Mark Wonsil) #11

And let’s not get into line endings…


(Calvin Krusen) #12

image

For

void bool Test() { bool ret = true; if(ret) { ret = !ret; } return ret; }

(Brandon Anderson) #13

careful guys!!