Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Could you give some examples?

[EDIT: unlike the other replies I don't actually disagree with the parent, I just want some examples!]



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 [1] http://en.wikipedia.org/wiki/Rendering_equation


Thanks 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!


Again 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


OK, I have a challenge for you. I'm going to rewrite the Gauss-Newton sentence slightly so it's still in "math notation", as you call it, but so that it will be clear and unambiguous (at least in my opinion). You do the same, rewriting it in "CS notation".

    Given m real valued functions r = (r1, …, rm) of n real variables β = (β1, …, βn), with m ≥ n,
Three extra words and I think I've done my job. What do you think?

what is the signature of those functions?

Well, they're each of type R^n -> R.

Do they have return values?

Yes, of course. They're functions. That's what functions have.

What type?

R

Are there multiple return values?

No, functions don't have "multiple return values".

Are the "n variables" the same for every function? Different?

Do you mean is the number of variables n the same for every function? Yes. Otherwise I don't understand your question.

Is it a matrix, indexed by the function?

Huh?

Why is m greater than or equal to n?

Good question. I don't know.

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.

Perhaps you can give me a further example, because I don't know what you mean by "CS notation".


[deleted]


You realize there are tomes and tomes defining languages standards just that

def foo (Real): Real

do not have any ambiguity, right?

I really don't see how this is much more clear than

r:R^m -> R^n

Anyway, functions in mathematics are not the same thing as functions in programming languages, one generally can simply can be called subroutine, the other is commonly called mapping, they are not even same stuff. They're not in the same class.

There's really no "mathematical notation" as you think there is, people just use conventions for what we have, you can invent your own and advocate that's it's better, physicists and engineers do that all the time, and people will decide about it, maybe it is and you invented the new decimal numbering system for all of mathematics but probably you're just too naive.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: