Tabs or Spaces to indent code?

General FreeBASIC programming questions.
Site Admin
Posts: 3799
Joined: May 27, 2005 8:08
Location: SP / Bra[s]il

Postby v1ctor » Sep 22, 2007 5:03

I'm too lazy to type spaces.

The tab-stop value needs to be at least 4 or my brain won't notice any indentation - i blame this tiny monitor with an absurd resolution.
Posts: 3500
Joined: May 16, 2006 22:34
Location: USA

Postby MichaelW » Sep 22, 2007 8:25

Tabs make for faster editing (because of faster navigation), but forums frequently don’t handle them well and much of what I code ends up being posted, and the difference is size is not significant, so I use only spaces. I actually do use the tab key to indent and add spacing, I just keep my editor set to expand tabs to spaces.
Last edited by MichaelW on Sep 22, 2007 9:02, edited 1 time in total.
Posts: 1704
Joined: May 27, 2005 6:34
Location: Cambodia, Thailand, Lao, Ireland etc.

Postby Sisophon2001 » Sep 22, 2007 8:52

I dislike tabs because most people using tabs actually use a mixture of tabs and spaces, (including some of the above who profess to prefer tabs) and it is horrible to correct when your code editor is set up differently.

I solve the problem by using a code formatter what provides consistent formatting throughout, regardless of what I type; with a good code formatter, it makes no difference.

And that reminds me, I need to update my code formatter, it is one year out of date.

Posts: 142
Joined: May 28, 2005 22:18
Location: Quincy, IL

Postby subxero » Sep 22, 2007 9:39

I use the tab key to make indents, but my editor is always configured to insert spaces instead of actual tab characters. When loading in files containing tabs, my editor is also instructed to convert all tabs to exactly three spaces.

I've always liked spaces. The disk space argument is relatively moot these days; a few extra K or M of spaces isn't a serious problem. I've also always disliked tabs because when viewing other people's code, it can look god-awful if they've used actual tab characters, and Sisophon2001 is correct - many programmers will use mixes of tabs and spaces, making it even more unorganized.

I'm obsessed with computer cleanliness; what can I say?
Posts: 88
Joined: Nov 30, 2006 13:35
Location: UK

Postby tinram » Sep 22, 2007 13:59

Spaces may help to develop RSI sooner (4 spaces to 1 tab in my editor).
Might not be a problem when you're young, but after 30 I started noticing it.
Posts: 1759
Joined: May 23, 2007 21:52
Location: Cut Bank, MT

Postby notthecheatr » Sep 24, 2007 21:56

Spaces, always. Like everyone else: tabs are different in different text editors, they screw up easily, and I've even used a text editor that converted it to spaces! Worse, though, is when it's *not* converted to spaces, because it's just plain weird. Each editor handles tabs differently.

I basically indent two spaces. It feels right, one space is not enough and more would be too much. Never mind the fact that it's been a habit since my QBasic and Pascal days...

Return to “General”

Who is online

Users browsing this forum: Richard and 5 guests