by phforms · 4y ago · 0 comments
But for me there is one exception that often hecks me up: comparative operators `<`, `>`, etc.
It might be due to the conditioning of infix notation in math education, but when I write `(< x y)` or `(> x y)` I somehow often manage to get the order confused, while this never happens with `x < y` or `x > y`.
I wonder if other Lisp programmers experience the same issue. This is my first year programming exclusively in Clojure, so maybe I just need more time to get used to it.
Compared to that mess, Lisp's s-expression is a breath of fresh air. The brain ignores the parentheses soon (just as the brain ignores the braces in C-like languages) and relies on the indentation to understand the structure of the code.
Having said that I do find the prefix notation slightly unintuitive for complex math formulas. Simple stuff like (< x y) is clear to me. No confusion there. But something like the formula for finding quadratic roots feels a bit unwieldy in s-expression syntax. I am sure that is because of years of conditioning of infix notation. Because pre-fix (or post-fix) are purer and unambiguous representations of the mathematical operations we perform. Yet conditioning has made pre-fix or post-fix hard to read for complex math formulas.
Maybe my problem was that when I write `(< a b)` I unconsciously read `< a`, which is where the confusion begins when I don’t explicitly think about the order. But the skiing guy helps to make it clear und easy to imagine what is going on (especially when I keep in mind that the operator is variadic in Clojure) and hopefully this will replace my “autocomplete error” in the long run.
Kinda!