Craig Says Tabs Are Evil, But I Like Them

0 comments suggest edit

TabI chuckled to myself when I read this “public service message brought to you by the Terminally Picky Developers Association for Readable Code” on Craig Andera’s blog.

I admit it, I’m guilty of using Tabs, but I have (at least in my mind) a good reason. Besides the fact that the code looks fine to me, I like navigating my code using the arrow keys. With tabs, when your cursor is at the beginning of the line and you hit the right arrow key, the cursor jumps to each tab position. If you convert tabs to spaces, you have to hit the arrow key two to four times (depending on your setting) for each tab. Unlike the “most discerning developers”, my tabs are set to 4 spaces so that wolud be quite annoying.

However, if a coworker was to raise a big fuss (or if I ever work with Craig), I’ll consider changing my evil ways.

And to my non-tech friends, yes, programmers are this anal.

UPDATE: Aaron Robinson notes in my comments that I could navigate with CTRL and the arrow keys. A good suggestion, and I often do that, but it requires two keys at a time instead of one. Also, in the case of moving text back, if I want to move a line back a tab, I like that I can just hit the backspace key rather than SHIFT+TAB. Once again, it’s one key verse two. When typing is painful, I like to reduce the number of keystrokes as much as possible. But maybe I’m just being lazy.

Found a typo or error? Suggest an edit! If accepted, your contribution is listed automatically here.



One response

  1. Avatar for Aaron Robinson
    Aaron Robinson December 8th, 2004

    Hold down the Crtl key when you right arrow and it'll take you right to the beginning of the line (and progressively to the beginning of each "word"), skipping any cluster of spaces or tabs.

    Which is a little more comfortable to do after you remap your Caps Lock key to be a Ctrl key...

    - Aaron