How explain why Python is easier/nicer than Lisp which has a simpler grammar/syntax?
Terry Reedy
tjreedy at udel.edu
Fri Aug 7 00:59:27 EDT 2020
On 8/6/2020 11:13 AM, Christian Seberino wrote:
> Python is my favorite language and the easiest to use in my opinion.
>
> Lisp has a far simpler grammar and syntax. A beginner I think could
> learn Lisp much faster than Python.
>
> Therefore, it seems like Lisp *should* be easier to work with and more readable. I don't feel like it is easier to use but I can't see *why* that is.
>
> My best guess.....
>
> Lisp pros: simpler syntax
> Lisp cons: prefix notation, lots more parentheses
>
> My hypothesis is that the cons slightly outweigh the pros of Lisp
> which is why Python is easier to work with and is more readable in the end?
Here is why *I* prefer Python.
1. Python mostly separates computation of values (expressions) from flow
control and name binding (statements). When the latter are mixed with
the former, most people restrict the mixing to a line or two.
2. Lisp code is one dimensional (though I presume there are now
formatting conventions). Python makes direct use of two dimensional
structuring.
3. Forcing everything into linked lists is 'cute', but it introduces
irrelevant asymmetries, differential nesting, and boilerplate that
obscures the problem relevant structure.
A list of equal status items:
(1,2,3) versus (1 (2 (3 NIL)))
A complete binary tree of depth 2:
((LL, LR), (RL, RR))
Left and right branches have same form.
versus
# ((LL, (LR, NIL)), ((RL, (RR, NIL)), NIL))
((LL (LR NIL)) ((RL (RR NIL)) NIL))
Left and right branches have different forms.
I think I got the Lisp version right, but I had to initially include
commas to do so. Anyway, the Python version was much easier to write
and is much easier to read.
--
Terry Jan Reedy
More information about the Python-list
mailing list