[Bf-committers] Text editor: "tab as space" as default? do we really need to push PEP8 that way?

Benjamin Tolputt btolputt at internode.on.net
Fri Mar 5 09:10:45 CET 2010


Mike Pan wrote:
> Personally I strongly prefer tabs over spaces, for simplicity's sake.  (a
> single tab is much faster than multiple spaces, and is more visible for
> indentation)
>   

You mention two things in the above paragraph that are not necessarily
mutually exclusive. I use a variety of code/text editors (XCode, MSVC,
Scite/TextAdept, & Eclipse) and all of them allow me to press TAB once &
it inserts multiple spaces. So the argument that pressing not using
TAB-to-spaces is not supported by the above.

> And for consistency's sake, I think Blender should always defaults to what
> most people comes to expect from a code editor, which means tabs are
> inserted as tabs, and not converted automatically to x number of spaces.
>   

Again, I do not expect my code editors to necessarily insert a TAB
character on pressing the TAB key, but to insert enough "whitespace" to
move me to the next predefined indentation level. This could be a TAB
key or it could be a sequence of spaces. I don't particularly care so
long as the code lines up correctly and doesn't look weird across the
multiple platforms I work on.

> When someone hits tab 3 times, and then hit backspace 2 times, there should
> be exactly 1 tab left (and not 2 tabs and 2 spaces), making the code editor
> do anything else fancy is just confusing to users.
>   

This, again, is something all the code editors I use can do whilst
inserting multiple spaces instead of TAB characters. In much the same
way the code editor adds just enough space characters to increase my
indentation level as expected; it can also remove just enough space
characters to return me to a previous indentation level.

None of what you mentioned precludes using the "tabs_to_spaces" setting,
so long as the code editor acts accordingly. Personally, I use "tabs to
spaces" in all my code editing environments so I know how it will look
regardless of a person's personal "TAB= X spaces" setting (which is, in
my experience a fifty/fifty chance of being *either* four or eight spaces).

-- 
Regards,

Benjamin Tolputt
Analyst Programmer



More information about the Bf-committers mailing list