English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

5 answers

No! I hate tabs, because every code editor displays them differently and I hate having to reconfigure the editor to change the spacing for tab characters. It's just so much easier to configure the editor to pad your tabs with, say, four spaces instead of a tab character. That way, you don't have to fight with it to make things line up later on.

2006-08-14 09:49:52 · answer #1 · answered by anonymous 7 · 1 0

No, the trouble with tabs is that if different people are editing the file, their editors will use a different number of spaces for the tab.

This would be okay, except that if anyone ever uses spaces as well as tabs, things get all messed up.

My editor can be told to emit n space characters when the tab key is hit, and I've asked other project members to use the same value of n. (3, in this case) This works pretty well, and the editor still allows me to select a block of code and indent/outdent with a single keystroke. I suppose that's the ultimate answer: Make the editor do the work for you!

2006-08-14 10:49:16 · answer #2 · answered by arbeit 4 · 1 0

Hard tabs are bad if you are going to view the code in multiple editors. It is better to use spaces if possible, this way you can just use a couple spaces for indentation instead of anywhere from 2-5 or more spaces depending on the editor.

2006-08-14 10:02:19 · answer #3 · answered by John J 6 · 0 0

This is a religious issue, and with the ready availability of tools like indent and astyle it really doesn't matter.

That said, I appear to be the only one who routinely uses tabs, mostly because provided the indentation is systematic (like say the auto indent features found in most modern programmers editors), it is my view that you should not need to be playing games with aligning blocks with the space bar.

Providing tabs are used, you can have any indentation you like on your editor and every other user will see what they like.

Important note: do NOT run Makefiles thru tools to convert tabs to spaces.... Amazing how much pain a stray space between the * and .cpp can cause late at night.

Regards, Dan.

2006-08-14 11:37:39 · answer #4 · answered by Dan M 3 · 0 0

hand coding eliminates crappy editors and their crazy quirks

2006-08-14 09:58:12 · answer #5 · answered by Anonymous · 0 4

fedest.com, questions and answers