3 ms·
As a trivial example, I would argue than infix notation[0] is needlessly complex, and that's pretty much the first math notation we introduce to children. In C
by erichocean 14y ago
As a trivial example, I would argue than infix notation[0] is needlessly complex, and that's pretty much the first math notation we introduce to children.
In CS, it's a notation we inherited from math and, literally, only use because of familiarity (the aforementioned introduction to children at an early age).
Infix sucks. It's ambiguous to parse, requiring the introduction of parenthesis. No one likes using the parenthesis, because it's ugly and takes up space, so on top of this (arguably bad foundation) we add in operator precedence. Genius -- except no one can remember all the rules. And when you leave out the parenthesis, and hand it to someone else, and it's ambiguous (i.e. has a complicated application of the operator precedence rules), how can you be sure the person meant what they wrote down?
The simple fact is that this:
2 2 +
Is no more difficult to a child to understand than this:
2 + 2
The former has a lot to recommend it, and high-end calculators use it for that reason. The latter just plain sucks. But thanks to math, and it's inability to improve its own notation over time, we teach infix notation to 5 year olds.
Now, this is super simple example, and math can't even get this much right. With more complex mathematics, we see additional symptoms of the above problems:
1. complex, implicit rules associated with the notation
2. a tendency to "leave important stuff off" because the notation is too verbose
The latter happens all the time. I work in 3D rendering, and basically no one writes out full equations for things, ever, because it's so verbose. So to save space, we just leave it out.
Now, I know it's missing, because one time, I just happened to see the full, correct equation. But what about that A la carte math user? Can they just read the paper and then go ahead and write some code implementing it? Not even close. Laughably not even close.
Of course, I cheated here, because even this equation is presented in dozens of different ways (I'm thinking here of the Rendering equation[1]). Depending on who's writing the paper, you'll have have to decipher it out -- including dealing with all of the "missing" stuff they've left out to save space.
All of math is like this, though. There's is no such thing as a self-contained math paper. Things are rarely "written out" at the level of detail we expect in CS.
[0] http://en.wikipedia.org/wiki/Infix_notation http://en.wikipedia.org/wiki/Infix_notation
[1] http://en.wikipedia.org/wiki/Rendering_equation http://en.wikipedia.org/wiki/Rendering_equation
- tome 14y agoThanks for the reply. I'm not convinced by your point on infix, but I do find it interesting. Regarding infix, in most mathematics that I've seen there tend to be only two levels of operator precedence: some form of multiplication taking precedence over some form of addition. It's in computer programming where you get multiple levels and it becomes hard to remember. 1. complex, implicit rules associated with the notation Again I would appreciate examples. the Rendering equation That's not really mathematics. It's a mathematical result of engineering presented in mathematical notation. If you want to argue that engineers horribly abuse mathematical notation then I'm right with you on that point!
- erichocean 14y agoAgain I would appreciate examples. How about this? This is copied and pasted from the first sentence of the Wikipedia page[0] on the Guass-Newton algorithm: Given m functions r = (r1, …, rm) of n variables β = (β1, …, βn), with m ≥ n, Quick, what is the signature of those functions? Do they have return values? What type? Are there multiple return values? Are the "n variables" the same for every function? Different? Is it a matrix, indexed by the function? Why is m greater than or equal to n? This sentence, to me, is an integral part of "math notation". Personally, the CS way of saying what functions and variables are, along with their signatures, along with a precondition on a couple of length properties, is far superior to the above math notation, even though it's, perhaps, more verbose depending on the programming language. The problem with the math notation is it's going to exclude anyone from understanding it who is not an abstract thinker even though nothing about it is actually abstract. It's become abstract only because we've been given the concrete ingredients, along with a written algorithm to construct the (now abstract) result. And we really need to understand that result to even finish the sentence! That's math notation in a nutshell. In CS, it'd be right there, concrete, unambiguous, sitting there on the screen (or page). In fact, you'd barely even need to say anything about it at all because there's nothing else, really, to say. CS notation is concrete and unambiguous. These kinds of abstract, inline definitions are integral to math notation, and constitute the bulk of the problem people have with math: you force simple, concrete things to be abstract just by the notation itself. [0] https://en.wikipedia.org/wiki/Gauss%E2%80%93Newton_algorithm https://en.wikipedia.org/wiki/Gauss%E2%80%93Newton_algorithm