Why is Python popular, while Lisp and Scheme aren't?

Richard Dillingham shadowlord13_1 at yahoo.com
Sat Nov 9 13:58:30 EST 2002


> The only thing that could make me at all comfortable with using Lisp
> would be if I had an editor that would color-highlight not keywords or
> strings, as color-highlighting usually goes, but levels of parenthesis
> indentation. So that this:
>
> (a (b (c (d e))))
>

> The prefix notation doesn't bother me overly much, but the parentheses
> kill it for me.

I wonder why you aren't writing
(a
    (b
        (c
            (d e)
        )
    )
)

That's much easier to read than what you had.

The issue with 'Python being easier to read than Lisp,' IMHO, is mainly that
Python FORCES you to use indentation, whereas Lisp does not.

Since Lisp does not force you to write readable code, you have to force
yourself to use indentation.

Whether this is a fault of the programmer for not behaving, or a fault of
the compiler for not forcing the programmer to behave, is debatable.

But I don't see a bunch of C programmers typing
if (a) { if (b) { if (c) { asdf; } else { zzzz; }} else { foo; }} else
{bar;}
like a Lisp coder might type
(if (a) (if (b) (if (c) (asdf) (zzzz)) (foo)) (bar))

Those are both unreadable, and much more reable written as follows:
if (a) {
    if (b) {
        if (c) {
            asdf;
        } else {
            zzzz;
        }
    } else {
        foo;
    }
} else {
    bar;
}

Or (and you could put comments in here to show where the else blocks are)
(if (a)
    (if (b)
        (if (c)
            (asdf)
            (zzzz)
        )
        (foo)
    )
    (bar)
)

Of course, Python's syntax is the easiest of all to read (due to needing no
{}s or ()s at all (for this)):
if a:
    if b:
        if c:
            asdf
        else:
            zzzz
    else:
        foo
else:
    bar

I personally like not needing the ()s or {}s for situations like this.





More information about the Python-list mailing list