3 ms·
Alright, that's one anecdote. But take a look at this one. In Python: a = 3 * 4 + 5 In Lisp: (setf a (+ 5 (* 3 4))) Now maybe it's just me, but balancing a
by dylandrop 13y ago
Alright, that's one anecdote. But take a look at this one.
In Python:
a = 3 * 4 + 5
In Lisp:
(setf a (+ 5 (* 3 4)))
Now maybe it's just me, but balancing all those parentheses and thinking in prefix notation gets a little hairy, especially if we introduce more math into a program (think graphics or ML).
- lispm 13y ago3 7 - + - 4 8 Can't write that in Python. Looks like Python does not support even basic math notation. Lisp does not even attempt to do that. We have to write (+ (/ 3 4) (/ 7 8)) or (+ 3/7 7/8) Let's say we want to write a slightly more complicated expression in Python: 2 2 +-+ 3+-+3+-------+2 3+-+2 3+-------+ - 2b x \|3 log(\|a \|b x + a + \|a \|b x + a + a) + 2 2 +-+ 3+-+2 3+-------+ 4b x \|3 log(\|a \|b x + a - a) + +-+3+-+2 3+-------+ +-+ 2 2 2\|3 \|a \|b x + a + a\|3 +-+3+-+3+-------+2 12b x atan(----------------------------) + (12b x - 9a)\|3 \|a \|b x + a 3a / 2 2 +-+3+-+ 18a x \|3 \|a Not possible. It does not know basic math format for roots, exponents, ... Lisp also does not know it. Balancing parentheses in Lisp is usually done with the help of an editor...
- dylandrop 13y agoFor the first part, it's still more intuitive (at least for me personally) to write a = 3/4 + 5/8 than (setf a (+ (/ 3 4) (/ 7 8))) and the primary problem that I have with the parentheses not closing them, but logically seeing how expressions link together. Even if you can click on an end paren and see the expression it closes off (as you can in most IDEs) it would be easier just to not have the extra parentheses there in the first place, so as to avoid the confusion. It's really hard for me to even tell what you're trying to write for the second part -- in Python or Lisp.
- lispm 13y ago(setf a (+ (/ 3 4) (/ 7 8))) I have no problem writing or reading that. Personally I like the parentheses a lot, since they allow me comfortable editing operations for such expressions. Additionally it makes it easy to computationally manipulate those expressions as data.