When you look at languages that actually, consistently use infix and mathematical notation (http://nsl.com/k/ray/rayq.k), they seem to give most programmers fits.
Infix also only really works for unary and binary operators, of course.
when mathematicians type f(x,y) they are using prefix notations.
likewise when programmers type run(x, y);
Anecdotally, most advanced mathematicians prefer Lisp because it is more conducive to a mathematical way of thinking. I am a very mathematical programmer and I prefer lisp specifically because I don't have to deal with operator precedence. Everytime you use infix notation you introduce a bunch of unnecessary complexity and often you complicate the ability to use simple recursion.
Gregory Chaitin, eminent mathematician, writes his proofs in Lisp for a reason.
Is it truly easier to write
print(a + " " + b + " " + c + " ");
rather than (print a " " b " " c " ")
?I greatly prefer the latter. The first one is weighed down with unnecessary special cases, unnecessary complexity.
The benefits of Polish notation are apparent with math as well. You don't need to reformulate the entire calculation and figure out messy operator precedence rules when you want to add a term. I think RPN lends itself to bug free code and easy modifiability.
To each his own I suppose. C-syntax to me is completely nonsensical and I don't see what problem it is meant to solve. I'm sure Russians view the Latin alphabet in the same way though.
I think a statement like "Most advanced mathematicians prefer Lisp" is pretty extraordinary and demands extraordinary citations.
Your comparison was dishonest, as you compared manual concat and print with a function that concats and prints. You really meant to compare full infix (e.g: in Haskell):
print $ a ++ " " ++ b ++ " " ++ c ++ " "
with full prefix: (print (++ a (++ " " (++ b (++ " " (++ c " "))))))
Which do you find more readable?The anti-precedence notion behind putting () around each application requires parenthesis even when associativity laws show that there is absolutely no difference between difference precedence interpretations. In this sense, the () are pure noise in this example.
Of course, if you use ++ so many times, you'd prefer to just use (in Haskell) something like:
print . intersperse " " $ [a, b, c]
Lisp's print has to embed the concatenation of its arguments or else it would look as horrible as shown above. It is still disingenuous to compare it as equal.(print (++ a " " b " " c " "))
But there are also objective factors.
Infix function application allows for easier visual parsing of the expression tree's components. There's a reason mathematicians have been using infix notation for centuries before we had arbitrary other constraints for choosing notation.
In fact, if you look at mathematicians' notation, you will see that not only is it horizontally infix (arguments left and right of the function), it is also vertically infix, and arguments are placed above and below (Sigma, Integrals, etc.).