3 ms·
I think lisp adds mental overhead for figuring out the precedence of operations - while other languages have a default that people understand. Perhaps if a lis
by lucidguppy 10y ago
I think lisp adds mental overhead for figuring out the precedence of operations - while other languages have a default that people understand.
Perhaps if a lisp editor was 3d instead of just parenthetically topographic (not just color coded) it may help people understand what is happening.
- ldjb 10y agoIt's perhaps a little confusing when first learning Lisp, but once you've got the hang of things, working out the precedence of operations is really easy. In most programming languages with infix operators, the precedence often depends on the operators themselves. For example, with: 5 + 3 * 10 ...You'd need to know that * has higher precedence than + to figure out the value of this expression is 35, not 80. But with the following Lisp expression: (+ 5 (* 3 10)) ...The syntax itself tells you the precedence, so there's no ambiguity. Even if you didn't know anything about the functions involved: (bar 5 (foo 3 10)) ...You don't need to worry about whether foo has precedence over bar or the other way round -- there's only one way to evaulate the expression.
- TeMPOraL 10y ago> I think lisp adds mental overhead for figuring out the precedence of operations - while other languages have a default that people understand. Wait what? Lisp removes the mental overhead by not needing the concept of "operation precedence" - prefix notation is unambiguous. The discomfort people have when looking at prefix math is because everyone here spent at least a decade being taught math in infix notation.