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

Robin Munn rmunn at pobox.com
Sun Nov 10 01:33:10 EST 2002


Martti Halminen <martti.halminen at kolumbus.fi> wrote:
> Richard Dillingham wrote:
> 
>> > 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))))
> 
>> 
>> I wonder why you aren't writing
>> (a
>>     (b
>>         (c
>>             (d e)
>>         )
>>     )
>> )
> 
> 
> A lisp programmer would write it like this:
> 
> (a
>  (b
>   (c
>    (d e))))
> 
> or the original: (a (b (c (d e)))) if using so short names and no
> control structures causing special indentation.

Both of you are right with regard to indentation; you can tell that I
don't use Lisp, as I am completely unfamiliar with proper indentation
techniques. The second form (with the closing parentheses lined up)
would confuse me if I tried to read someone else's code, whereas the
first (sort of C-like) form of indentation allows me to see at a glance
which parenthesis is being closed where.

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

And that has become one of the major reasons why I like Python: I can
read code written by anyone, even language newbies, and understand it
without having to puzzle out their indentation style. The other reason
why I like Python is the power of introspection. (I have this peculiar
mental "image" of a TV commercial like the "Behold the power of cheese!"
commercials found on US television, except the slogan is "Behold the
power of introspection!")

>> 
>> Since Lisp does not force you to write readable code, you have to force
>> yourself to use indentation.
> 
> For a beginner it might be forcing, for the professionals it is a major
> tool. Not using the canonical indentation style is a sure sign of a
> newbie in comp.lang.lisp.
> 
>> 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))
> 
>> (if (a)
>>     (if (b)
>>         (if (c)
>>             (asdf)
>>             (zzzz)
>>         )
>>         (foo)
>>     )
>>     (bar)
>> )
>> 
> 
> (if (a)
>     (if (b)
>         (if (c)
>             (asdf)
> 	  (zzzz))	  
>       (foo))
>   (bar))
> 
> Would be the normal way to write this.

Well, I can understand the structure behind the canonical Lisp
indentation style. And it might be horizon-broadening to attempt a
serious program in Lisp sometime. But despite the fact that I *know*
there's logical structure to it, seeing Lisp code still makes me think
of "You are in a maze of twisty little parentheses, all similar." :-)

Incidentally, I am not trying to bash Lisp; it's just that my own
initial reactions were negative, and I haven't found the positive in it
that I know to be there. But having found a language (Python) that
thinks the way I do, and being able to have my thoughts flow into real
code without the language getting in the way, I find myself disinclined
to invest time and mental energy learning a language that *doesn't* flow
for me.

My general take on why Python is popular, while Lisp and Scheme aren't?
For most people, learning Lisp seems to be an uphill struggle, whereas
Python simply *flows*.

-- 
Robin Munn <rmunn at pobox.com>
http://www.rmunn.com/
PGP key ID: 0x6AFB6838    50FF 2478 CFFB 081A 8338  54F7 845D ACFD 6AFB 6838



More information about the Python-list mailing list