April 23, 2007
Lisp and Python Syntax

T. rexes doing it

Just typing the title above is making me preemptively cringe at the idiots it's going to attract.

Amit on Lisp and Python syntax:

Lisp seems to be optimized for writing code; Python seems to be optimized for reading it. Which you prefer may depend on how often you write new code vs. read unfamiliar code; I'm not entirely sure. What bothers me the most though is not that these two languages do different things, but that the people who argue about it seem to think that there is one “best” answer, and don't see that this is a tradeoff. When I'm writing code I prefer Lisp; when I'm reading code I prefer Python. I think this is an inherent tradeoff—any added flexibility for the writer means an added burden for the reader, and there is no answer that will be right for everyone.

I think even after 13 years of doing Lisp and 3 or 4 years of Python, I agree: I prefer writing Lisp, but Python is easier to read. Which is not necessarily a bad thing (I completely agree with Amit on how annoying it is when people see these things as absolutes instead of tradeoffs).

Posted by jjwiseman at April 23, 2007 10:29 AM
Comments

The comparison might have been better if more explicitly qualified.

After all, it's perfectly possible to write Lisp restricting yourself to a similarly well-established syntactic subset as what Python is inherently limited to. In other words, even if indeed avoiding use of macros, Lisp's most important feature, you're still left with a pretty damn powerful language.

(Nothing in the article points out parentheses as a readability problem, merely the possibly unknown syntactic meaning and evaluation rules in macro-based Lisp code you didn't yourself write.)

Posted by: Arto Bendiken on April 23, 2007 01:21 PM

PG made a related point about Python readability here: http://www.paulgraham.com/pypar.html

Posted by: Edward O'Connor on April 23, 2007 04:07 PM

What the heck are those two dinosaurs doing, both the picture and the skeletons? It doesn't look like combat... where did you get that picture?

Posted by: Jeff Rush on May 16, 2007 06:27 AM

Birds do it, bees do it, even ancient carnivorous lizards with stubby little arms do (did) it.

Posted by: John Wiseman on May 16, 2007 05:41 PM
Post a comment
Name:


Email Address:


URL:




Unless you answer this question, your comment will be classified as spam and will not be posted.
(I'll give you a hint: the answer is “lisp”.)

Comments:


Remember info?