3 actual spaces when manually indenting (e.g. writing some code in a textbox)
4 spaces-long tabs for ``I don't have sane indentation rules''-languages. M-x indent-sexp and M-x indent-region for Lisp. ; for Python.
Intenting with tabs is OK if you never intend for the file to move from your computer. Otherwise, indenting with spaces ensures the file is readable anywhere.
Name:
Anonymous2011-06-01 21:52
>>18
Indenting with tabs is preferable because each user can set their own tabwidth. If they prefer 8, it will be 8. If they prefer 2, it will be 2. So on and so forth.
What's readable and preferable by you isn't necessarily as readable and preferable for other people.
>>19
The source should also be readable in less or any other program. Having to fuck with the tab width just to get things to align properly shows you haven't understood the issue.
Name:
Anonymous2011-06-02 20:51
>>22
Seems like you haven't understood the issue yourself because alignment isn't a problem at any tab size (except 0, obviously) unless you're misusing them.
Tab width has nothing to do with aligning. It's there to align it how YOU prefer it and it will STILL show properly on a console with less/grep/whatever because a tab is a tab.
It's not going to magically transform into another character and unalign itself.
I remember in my first semester of my first year, I was marked down on style for one of my assignments because I "used 8 spaces" to indent my code.
They were tabs.
>>24
You never see a file with eg. tab width 8 and indent width 4? Unless you configure your editor to whatever the original author used, it'll look completely fucked. Spaces all the way.
Name:
Anonymous2011-06-03 11:58
>>31
What?
Files don't have inherent tab widths. A tab is a single character that can be interpreted in different ways. If you use it properly for indentation it doesn't matter what you set your own tab width to, text will always end up aligned nicely.
>>38 I don't do that, but others do. If they'd use spaces it wouldn't matter what the fuck their settings were, but they didn't and everyone else have to suffer.
>>39
You use spaces exclusively? That's just as bad. Tabs for indentation, and if you really feel autistic enough to line up your 0s and 2s, then do something like --->if(foo) {
--->--->char quux[4] = {0, 1,
--->--->................2, 3};
--->}
will suffice.
hey guy's i havent bothered to install a hook to convert file's that are indented using space's when I load them and my editor is too retarded to even have this ability so im going to say that people who uses space's are dumb
people who use space's are dumb.
ps i use four space's all the time even in language's where the style guide says to use tabs or 2 space's