Compare source code

Mark Wooding mdw at distorted.org.uk
Thu Nov 4 12:49:32 EDT 2010


Seebs <usenet-nospam at seebs.net> writes:

> Python's the only language I use where an obvious flaw, which is
> repeatedly observed by everyone I know who uses the language, is
> militantly and stridently defended by dismissing, insulting, and
> attacking the character and motives of anyone who suggests that it
> might be a bit of a nuisance.

So you've not tried Lisp, then?  Dissing Lisp's parentheses tends to get
a pretty similar reaction.

My observations on this general discussion.

  * Python is far from unique in its use of significant whitespace.
    Miranda was inferring program structure from indentation in 1985.
    Haskell and F# are more modern examples.

  * I don't have many problems with tools trashing whitespace in Python
    programs, though I have seen web forum software mangling
    indentation; since this makes nontrivial chunks of almost any
    programming language illegible, I'm more than willing to blame the
    forum software for this.  I haven't personally seen indentation
    trashed by email software, for example (though I steer well clear of
    people who try to send me HTML mail).

  * I /do/ have a significant problem with cutting and pasting code in
    Python.  In most languages, I can haul a chunk of code about, hit
    C-M-q, and Emacs magically indents the result properly.  This is,
    unfortunately, impossible with Python.  It has caused me real bugs,
    and I have to be extra careful to fix the indentation up.

  * I've just noticed that Emacs's Python mode has a magic keystroke
    which appears to do the right thing for cut-and-pasted code.  This
    is symptomatic of a bigger problem: simply by being different from
    the mainstream, Python requires that one work with it differently.
    It requires different tools, and different techniques.  Many
    languages use some kind of brackets to mark substructure, so tools
    have become good at handling bracketed substructure, whether for
    automatic indentation or navigation.  Python marks (some)
    substructure differently, so users need to learn new techniques or
    tools for working with it.

I /like/ Python.  I use it frequently.  I /don't/ want to change its
structure marked by indentation.  I'm /willing/ to put up with some
inconvenience because Python makes up for it in other ways.  But there
/is/ inconvenience, and it does need putting up with.  I think the
benefits are worth the costs; others may disagree.

-- [mdw], a smug Lisp weenie at heart.



More information about the Python-list mailing list