KBD

Keith Devens .com

Friday, August 8, 2008 Flag waving
I have never met a man so ignorant that I couldn't learn something from him. – Galileo Galilei
← Extend Firefox Contest Finalists Announced - MozillaZine TalkbackMy PHP form doohicky library is awesome →

Daily link icon Tuesday, February 7, 2006

More on tabs vs. spaces

So, at work I've just been using the default settings on Visual Studio to determine my brace style and indent style. To my surprise I've found the spaces vs. tabs issue far more important than having my code look "double spaced" with braces on their own lines. For one, ASP.NET doesn't get you very dense or detailed code anyway, so it doesn't matter as much that there are some extra blank lines spacing out the code. The thing that's annoyed me about having leading spaces instead of tabs is that it gets real old real fast having to hit the backspace key four times the number of times I'd have to hit it were I using tabs. Say I hit the tab key an extra time by accident... that's four times I have to hit the backspace key. In fact, that's an extra argument for using tabs I hadn't considered before. A one-to-one correspondence not only between the number of times you hit 'tab' and the number of characters put in the file, but between the number of times you hit 'tab' and the number of times you have to hit 'backspace' to remove that "tab".

← Extend Firefox Contest Finalists Announced - MozillaZine TalkbackMy PHP form doohicky library is awesome →

Comments XML gif

Nathan wrote:

I had the same problem I ended up going back to tabs. What VS needs it to let you treat a sequence of multiple spaces as 'logical' tab so that backspace would take out all of them.

∴ Nathan | 7-Feb-2006 11:27pm est | #9109

Keith (http://keithdevens.com/) wrote:

Yeah, I actually thought jEdit did just that, but I checked and it didn't. I just always use tabs.

Say you have three levels of indentation. That's 12 times I have to sit there and hit backspace. Ugh.

Keith | 7-Feb-2006 11:29pm est | http://keithdevens.com/ | #9110

Andrew Wooster (http://www.nextthing.org/) wrote:

SubEthaEdit does this, which is one of the reasons it's my default editor.

∴ Andrew Wooster | 7-Feb-2006 11:46pm est | http://www.nextthing.org/ | #9111

David Lindquist wrote:

Emacs has a feature called Hungry Delete that helps ease the tabs-vs-spaces pain for users of that particular "editor". Smiley

∴ David Lindquist | 7-Feb-2006 11:51pm est | #9112

Hannibal wrote:

You wouldn't be so worried about it if you would stop making mistakes. I never have to use the backspace key.

∴ Hannibal | 8-Feb-2006 5:12pm est | #9116

Bone wrote:

Keith, I thought you switched to Ubuntu? You're developing with Visual Studio? Anyway, I stick with tabs mainly because of that annoying backspace situation and try to leave in the header comment of my code how many spaces my tabs equal so that other people editing it can set their editors accordingly. Also, kudos on the Monster energy drink suggestion. Its all I drink now. Hope you're doing well in Tennessee.

∴ Bone | 11-Feb-2006 6:55pm est | #9123

Keith (http://keithdevens.com/) wrote:

Visual Studio at work, so it's not relevant what I use at home. Though, I happen to not be using Ubuntu at home either anymore since my main computer is now a laptop, and it's not exactly Linux friendly.

Doing pretty well in Tennesee, thanks man. Much better than I was when I was working for charlatans.

Keith | 11-Feb-2006 10:01pm est | http://keithdevens.com/ | #9125

Wayne wrote:

Sometimes shift-tab unindents. For really space unfriendly editors the workaround is to type in the closing brace before typing the inside of your block.

I mainly use delphi which has had "backspace unindents" forever.

∴ Wayne | 16-Feb-2007 12:27am est | #9960

Feel free to post a comment below. Please see my comment policy.

Formatting Rules (No HTML):

  • **bold**, *italic*, _underlined_, --strikeout--
  • "text"="url" creates a link, and URLs are auto-highlighted
  • Blockquote: Like e-mail, begin paragraph with > (greater-than sign)
  • Lists: begin paragraph with *,-, or + (unordered), or # (ordered)
  • Code block: ?!code:language=perl|php|sql|javascript|etc.{\n}...{\n}?!/code

:
(will be your IP address if blank)
: (optional)
(Will not be shown on site)

: (optional)
:

August 2008
SunMonTueWedThuFriSat
 12
3456789
10111213141516
17181920212223
24252627282930
31 



RSS feed RSS feed for Keith's Weblog
Atom feed Atom feed for Keith's Weblog
Weblog archive
Recent comments
  on 1 posts

Recent comments XML

Spider solitaire

Dont be silly - there are a great %​that cannot be won - freecell for​examp...

mZex: Aug 4, 6:57am

Generated in about 0.266s.

(Used 8 db queries)

mobile phone