PEP8 and 4 spaces

Ben Finney ben at benfinney.id.au
Mon Jul 7 03:00:59 CEST 2014


Dan Stromberg <drsalists at gmail.com> writes:

> But I finally acknowledged that some very smart people don't
> understand tabs, or don't want to learn how to use them.

One day, you may reach the further realisation that those same very
smart people *do* understand tabs, and *do* know how to use them — and
nevertheless choose not to put them in source code, for good reasons.

> Also, I figured out how to get python files to use spaces and
> Makefile's to use tabs, using some slight vim configuration.

The makefile syntax is one of the excellent examples of why it's a
terrible idea to use tab characters in source code. It's also an
excellent example of how a poor design decision (a line beginning with
U+0020 SPACE is semantically different from a line beginning with U+0009
CHARACTER TABULATION) can be irrevocable – the syntax can't be changed
now, without breaking compatibility for countless makefiles out there
already – and cause endless confusion and wasted effort dealing with it.

Using a mature, well-customised, language-agnostic programmer's editor
does make it much better: Vim and Emacs can both seamlessly handle “tabs
are forbidden by default” as a configuration choice, along with “tabs
are necessary in make files, using spaces in the wrong place is an
error” at the same time.

> So I'm using 4 spaces now.
>
> It's nice not having to ignore the relevant pep8 and pylint warnings
> anymore.  And I don't miss tabs nearly as much as I thought I would.
> In fact, I'm not sure I miss them at all.

Hooray! Welcome to the light :-)

-- 
 \                   “The best ad-libs are rehearsed.” —Graham Kennedy |
  `\                                                                   |
_o__)                                                                  |
Ben Finney




More information about the Python-list mailing list