4 ms·
Until children are taught S-expressions in elementary school math, infix math notation will always be more familiar to the general population, and there will al
by cicero 10y ago
Until children are taught S-expressions in elementary school math, infix math notation will always be more familiar to the general population, and there will always be a learning barrier that must be overcome to gain similar skill with S-expressions, no matter how superior they might be.
- JaumeGreen 10y agoBut we are all using S-expressions without noticing. What do you say "Add 3 and 4" or "Take 3 and add 4"? That is the same with most things, we say the verb before the object(s).
- abrax3141 10y agoYes, that right. And moreover, much math isn't infix: Factorial is postfix. Sum, Product, and Integral are prefix. Infix is actually the exception, and is not semantically uniquely without parens anyway (languages have different orders of operation!), so folks should just get over the mindless prefix hate.
- cicero 10y agoYour English notation is not really an S-expression. I would say it is similar in that the operation comes first. Even though people understand such notation for simple expressions, most people are not used to doing advanced (beyond elementary school) math using such notation. I agree that the concepts behind S-expressions are simple and logical, but expressing an entire program using S-expressions is an additional thing that must be learned. Other languages chose a syntax that is closer to what people are used to and that helps with the adoption of the language, even if the language loses other capabilities.
- taejo 10y ago"What is 6+1*0-2/2?" memes/threads on Facebook have taught me that infix math notation is more or less completely unfamiliar to the general population. At least sexprs are fully parenthesized.
- cicero 10y agoIf you are talking about order of operations, all of the sixth graders that I teach know how to evaluate that expression. While it's true that I had to teach them * means multiply and / means divide, they can quickly pick that up. Our school is all honors and the students are above average intelligence, but they are not all math or tech geeks. On the other hand, I have taught courses at the high school level at the same school based on "How to Design Programs" [1] using the Racket language. Although I can explain the concept of (+ 6 (* 1 0) (/ -2 2)) rather easily, the students make mistakes writing expressions for several weeks. 1: http://www.ccs.neu.edu/home/matthias/HtDP2e/ http://www.ccs.neu.edu/home/matthias/HtDP2e/
- taejo 10y agoI wasn't entirely serious, and I believe sixth-graders can evaluate infix expressions with correct order of operations, but it was adults I was referring to, many of whom have long forgotten.
- agumonkey 10y agoI can't take the infix arithmetic argument anymore. In any interesting piece of software, such arithmetic will only be 5% of the problem. You'll deal with many other concepts, combinators, morphisms, trees, vector spaces, geometry ... which are often functional in syntax (Ker <morphism>) ... Plus when you're used to trees, linearization and parsing, you *fix the way you see fit, pre post or in ...