3 ms·
For indentation, I want to type tabs and get spaces. I suspect many others are in this boat and it could complicate the poll a bit since it's not specified whe
by petercooper 14y ago
For indentation, I want to type tabs and get spaces.
I suspect many others are in this boat and it could complicate the poll a bit since it's not specified whether we're voting for what we prefer to use on the keyboard versus what we prefer to actually end up in our files..
- hboon 14y agoThanks. Updated the poll to clarify this.
- hboon 14y agoWhy do you want to end up with spaces? Consider the alternative: if you end up with a tab, what's the downside?
- drcyrusflame 14y agoOther coders you might be working with on the same project may be using a different editor with different tab-width settings which may lead to improper indentations making it hard to read the code.
- dragonwriter 14y agoWhat I'd generally prefer is tabs (keyed and stored) for block-structure indententation, and spaces for visual alignment of single logical expressions broken into multiple lines for readability (where you are aligning the following lines with some element of the preceding line.) This, incidentally, will preserve correct relative indentation regardless of tab settings in editors (it would even work for python, since you only have the first kind of indentation in python given python's indentation sensitivity, but the convention of spaces-over-tabs is so strong in Python that its not worth debating, given how much higher the cost of inconsistency is compared to the cost of choosing the less-ideal option consistently.)
- lutusp 14y ago> if you end up with a tab, what's the downside? The downside is that different environments (and different languages) will interpret the tab differently. Not so for spaces. This is not usually an issue unless both tabs and spaces are used in the same file, and that was my qualifier.
- petercooper 14y agoConsistency. Sometimes I might use tab, sometimes I might notice something's off by one and use a space (for right or wrong, habits + muscle memory etc.) I also use code from other developers who may be even more inconsistent or pick one over the other. If everyone just uses spaces - as in common in the worlds I work in - a lot of the above issues are prevented.
- lutusp 14y ago> For indentation, I want to type tabs and get spaces. My editor Arachnophilia has the option to generate spaces when the tab key is pressed. I'm sure some other editors work that way too.