Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re: Tabs vs Spaces lets give this a go

by xorl (Deacon)
on Oct 09, 2006 at 12:55 UTC ( #577161=note: print w/replies, xml ) Need Help??

in reply to Tabs vs Spaces lets give this a go

Interesting. In 10 years of programming, I've never encountered someone who uses spaces to indent code. I'm truly shocked by the number of people here who use spaces.

I've not taken many CS clasess, just one here and there as required by work (and none at the same college). All of them wanted the code indented and wanted tabs used.

To me tabs offer 3 things that spaces don't:

1) smaller file size

2) easy to change the with in the editior by just changing the location of the tabstops.

3) who the heck is going to want to count out 16 or 32 spaces when you can just hit tab 2 or 4 times?

Thoses are my reasons. I'm sure other people will have other reasons.

The more interesting thing about this thread is the strong feeling it seems to have evoked. I really don't understand it. If your shop uses spaces, use spaces. If it uses tabs, then use tabs. If you're lucky and work in a small one man shop, then use whatever the heck you want or maybe don't even indent. This shouldn't be such a big deal.

Let's all take a deep breath and count to 100 before anyone makes another post.

Replies are listed 'Best First'.
Re^2: Tabs vs Spaces lets give this a go
by itub (Priest) on Oct 09, 2006 at 19:39 UTC
    1) Smaller file size is a negligible advantage nowadays IMO. 2) Yep, that's usually true. 3) Surely you are joking! Any half-decent text editor that lets you choose spaces for indentation will use the tab *key* for indentation, but producing the right amount of space *characters* on the file. It will also support autoindent, and maybe even "smart" autoindent (although I personally hate the latter).

    In my experience, although the argument for tabs is pretty logical, it doesn't work that well in practice. Years ago I thought a lot about the issue, decided to use tabs, and configured my system accordingly. It ended up being a lot of trouble whenever I interacted with anyone else or got source code from anywhere else. Even without interacting with other people's code, I had trouble because I was using a variety of programs on a variety of platforms, and not all of them let you configure the tab stops (or it wasn't worth the time). I switched to spaces and I've been much happier ever since. :-)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://577161]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (2)
As of 2020-07-04 05:49 GMT
Find Nodes?
    Voting Booth?

    No recent polls found