

Math Notation is Terrible - edw519
http://sandersn.com/blog/index.php?title=math_notation_is_terrible&more=1&c=1&tb=1&pb=1

======
yummyfajitas
It's true, especially for papers about algorithms. But if you need to do
complicated calculations, math notation is useful; compactness does help you
keep everything in your head.

Most fields standardize notation quickly, and conventions helps also. In a
physics paper, $\rho$ is a density and $\psi$ a wavefunction. Any author who
gratuitously forks notation deserves to be rejected (with instructions to fix
the notation).

As for "too many subscripts", I'm not sure how other notation could fix it.
That's just a problem coming from nested loops (sums, integrals, whatever): if
you can't get rid of them, what can you do? Is ∑_x ∑_y f(x,y)

worse than

    
    
        tmp = 0
        for x = ... :
            for y = ...:
                tmp += f(x,y)
        return tmp

~~~
andreyf
I agree, but the last part (assuming you meant to write in Python), could be
written as:

    
    
      sum(f(x,y) for x in X for y in Y)
    

...which, ironically, is syntax inspired by mathematical notation :)

------
Tichy
Sorry, bit math formulas in code are really unreadable. Bad, bad idea. It's
the only downside of the popular book "Collaborative Intelligence" that it
doesn't give proper maths formulas, only code.

~~~
Kaizyn
Funny, I find just the opposite to be true for me. Formulas in code are easy
to understand while math in notational form isn't.

~~~
Tichy
I like to be able to take it all in at one glance. Sure, I can read code, but
only "command by command", it is hard to see the big picture - for me, anyway.

I think math notation evolved over centuries, too. That's not a proof that it
could not be improved upon, but I remain sceptic.

What will be next, musical notation? OK, admittedly

play_c play_d play_e play_f# is more readable than musical notes in a way
(namely, if you can't read notes), but I bet that if you want to actually play
the notes with an instrument, you might eventually prefer the classical
notation. Although for music, there are alternative notations that make sense
in special cases. Maybe for maths it will be the same.

Anyway, anybody who writes a maths paper is free to choose the representation
they want.

------
LogicHoleFlaw
The article itself is interesting, but what really caught my eye was the 5
flaming comments it received. Bitter much, guys?

~~~
timr
Well, I generally agree with the premise of the article (math notation sucks),
but I also agree with the five flaming comments -- his example was bad.

In particular, the "optimized" code was atrociously unreadable. It may have
used fewer lines, but those lines were so packed with cleverness that they
took more work to understand than the original notation. The first version of
the code was okay, but probably not much easier to understand than the
original math.

There are some very bad examples of mathematical notation out there, but this
wasn't really one of them.

